Quoting Austad, Jay (austad at marketwatch.com): > What's a good tool to use to monitor if a particular process is running, and > then restart it if it dies? > > Preferably a perl or a shell script as I don't have compilers on the box I > need to use it on, and I want to stay far far away from DJB's daemontools. Here is what I use for my setiathome script. Homebrew. #!/bin/bash # Source function library. . /etc/rc.d/init.d/functions pid=`pidofproc setiathome` if [ -z "${pid:=}" ]; then if [ ! -x $HOME/.setiathome/`hostname`/setiathome ]; then echo "Error: Cannot execute setiathome. Aborting." fi cd $HOME/.setiathome/`hostname` if [ $? -ne 0 ]; then echo "Error: Cannot cd to setiathome directory failed. Aborting." exit 1 fi echo "Starting setiathome on CPU" nice -10 ./setiathome & fi exit 0 -- Minneapolis St. Paul Twin Cities MN | Phone : (952)943-8700 http://www.mn-linux.org Minnesota Linux | Fax : (952)943-8500 Key fingerprint = 6C E9 51 4F D5 3E 4C 66 62 A9 10 E5 35 85 39 D9