1 #!/bin/sh 2 3 4 #-------------------------------------------------------------------------# 5 # proc.monitor # 6 # This script verifies that the named process is running. # 7 # It actually just greps the process list for the string you pass in # 8 # # 9 # Standard UNIX status: returns 0 on good, non-0 on bad. # 10 # # 11 # Provided as a tool to be called from 'monitorhasrv' # 12 # # 13 # Normally, there would be companion 'proc.start' and 'proc.stop' # 14 # scripts. But that would seem to be a bit redundant, for this case # 15 #-------------------------------------------------------------------------# 16 17 18 if [ -x /usr/ucb/ps ] ; then 19 PROCLIST="/usr/ucb/ps aux" 20 else 21 PROCLIST="ps -ef" 22 fi 23 24 25 26 $PROCLIST | fgrep "$*" >/dev/null 27 28 if [ $? -eq 0 ] ; then 29 exit 0 30 fi 31 32 exit 1 33