From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,4f3eaecba732bda2 X-Google-Attributes: gid1164f8,public X-Google-ArrivalTime: 1992-10-26 07:46:06 PST Newsgroups: comp.sys.dec Path: sparky!uunet!ukma!darwin.sura.net!haven.umd.edu!decuac!hussar.dco.dec.com!mjr From: mjr@hussar.dco.dec.com (Marcus J. "Will do TCP/IP for clues" Ranum) Subject: Re: Help... Message-ID: <1992Oct26.185729.25420@decuac.dec.com> Sender: news@decuac.dec.com (USENET News System) Nntp-Posting-Host: hussar.dco.dec.com Organization: Digital Equipment Corporation, Washington ULTRIX Resource Center References: <1992Oct25.050041.20443@ncsu.edu> Date: Mon, 26 Oct 1992 18:57:29 GMT >I need to run a shell script that will check to see if a process is >running, and if it is not, then make run it. This is usually done by having the process you want to check write its process-id to a file someplace. The second process just sits in a loop and wakes up every minute (or whatever) and does a "kill 0" on the process you want to check. You then test the exit value of kill. Easy. #!/bin/sh while true; do sleep 60 kill -0 `cat /some/dir/process.pid` if [ $? -ne 0 ]; then echo "process died" /start/some/process fi done mjr. PS - (another option is to not run those LPMuds that crash alla time, if that was your question. ;) ) -- You can't fix stupidity with software. -notebooks of a heretic