I need to restart a script when it fails. My script fails because of a Ruby runetime bug which is another issue...
A:
There might be cleaner ways of doing it, but it seems the obvious way is to have a separate process running that monitors the first one. If it is not running, restart it.
You can enumerate processes and get information about the command line and other details in order to know which script is being run.
Mark Wilkins
2010-02-20 15:12:01
Follow up, is this much easier on linux?
Zombies
2010-02-20 18:19:45
It is probably about the same amount of work. I don't have the information on how to do it in Linux at my fingertips.
Mark Wilkins
2010-02-20 23:27:25
@Zombies: I just had a moment to refresh my memory on the Linux side of it. I *think* the standard way is to enumerate the "files" in /proc. You can use `opendir` to enumerate those and retrieve details.
Mark Wilkins
2010-02-21 14:37:42