that is similar to what i did, hold on, i'll show you what i didSirDice said:Having thought about this a bit, you can probably get away with a really simple cron entry.
Cronning something like pgrep myprogram || /usr/local/bin/myprogram might just be enough.
Pgrep returns 0 when 1 or more processes are found, if that's the case the other part of the logic OR is executed. When pgrep returns 1 (when no processes are found) execution stops (the other part of the OR is not executed).
#!/bin/sh SERICE= if pgrep -u $USER $SERVICE > /dev/null then echo "$SERVICE service running, everything is fine" else echo "$SERVICE is not running" fi
i'm really new to this sort of stuff but if people push me in the right direction i can do it =)