Click to See Complete Forum and Search --> : Automatically starting a program if it crashes- how can I do this?


Captain Penguin
07-08-2001, 09:35 PM
I am running Mandrake 8.0 on my old p100 w/ 64mb of ram to host a MUD game server.

My problem is that the code is buggy (I hope to fix it one day when I'm more knowledgable in C), and somethings trigger the game to crash with a Segmentation Fault.

Is there a way I can make the file automatically restart if it crashes, in case I'm not around? I don't want to piss off my players :)

X_console
07-08-2001, 10:59 PM
What you could do is to create a script that checks if the program is still running. If it is, then exit the script, and if it's not, then restart the program. Once that's done, setup a cron job to run the script every minute. Now every minute, your script will check if the program is running. If it's not, then it will restart the program.

Hope that helps.