I have 2 server programs that must be started with the use of GNU Screen. I'd like to harden these servers against crashes with a Python based program that kicks off each screen session then monitors the server process. If the server process crashes, I need the python code to kill the extraneous screen session and restart the server with screen again.
I'm very new to python but I'm using this opportunity to teach myself. I'm aware this can be done in bash scripting. But I want to build on this code for future features, so it needs to be just python.
The pseudocode is as follows:
thread-one {
While 1:
start server 1 using screen
wait for server to end
end while
}
thread-two {
While 1:
start server 2 using screen
wait for server to end
end while
}