in reply to Process Reliablity

Nice, elegant suggestions, and I would recommend using the pid file approach. There is a trick how you can make this file disappear even if the process crashes (some inode trickery, but I cannot give an example right now).

If you need a quick hack, I can offer you two low level solutions (sort of). Assuming you are using some sort of unix, you might want to try this:

1. Use a wrapper script to start your program. It can restart it whenever the program crashed:

#!/bin/sh while true do start_your_program sleep xxx done
Advantage: the auto restart releaves you of checking all the time.
Beware, though, that this might mean trouble if your program does ugly things when restarted after a crash and might put considerable load on your machine in a continous start-crash-restart cycle if you omit a proper sleep time.

2. You might grep through the process list to see if you program is running. This works if it has a sufficiently long and distinct name. Try on a shell:

ps aux | grep your_program_name | grep -v grep | wc -l
or
ps -ef | grep your_program_name | grep -v grep | wc -l
depending on which unix flavour you use.
This returns the number of instances of your program running (i.e. usually 0 or 1). YOu can use that from a perl script, too, putting the expression into backticks (``).

Hope that's a bit useful. Kind of old techniques, but it still works (most of the time) ;-)

Andreas