path: nagios4_4.4.6-4.1/functions # Next try "pidof" # if which pidof | egrep -v "^no pidof" >/dev/null 2>&1; then # pid=`pidof $1` # if [ "$pid" != "" ] ; then # echo $pid path: nagios4_4.4.6-4.1/functions # A function to find the pid of a program. pidofproc() { # Test syntax. if [ $# = 0 ] ; then path: nagios4_4.4.6-4.1/functions # See if it's already running. pid=`pidofproc $base` [ -n "$pid" ] && ps -p $pid >/dev/null 2>&1 && return path: nagios4_4.4.6-4.1/functions #fi #if which initlog | egrep "^no pidof" >/dev/null 2>&1; then # IN_INITLOG="not found" #else path: nagios4_4.4.6-4.1/functions fi # Next try "pidof" # if which pidof | egrep -v "^no pidof" >/dev/null 2>&1; then # pid=`pidof $1` path: nagios4_4.4.6-4.1/functions # Find pid. pid=`pidofproc $base` # Kill it. path: nagios4_4.4.6-4.1/functions base=`basename $1` pid=`pidofproc $base` if [ "$pid" != "" ] ; then echo "$1 (pid $pid) is running..." path: nagios4_4.4.6-4.1/functions # Test syntax. if [ $# = 0 ] ; then echo "Usage: pidofproc {program}" return 1 fi path: nagios4_4.4.6-4.1/functions # Next try "pidof" # if which pidof | egrep -v "^no pidof" >/dev/null 2>&1; then # pid=`pidof $1` # if [ "$pid" != "" ] ; then path: nagios4_4.4.6-4.1/debian/nagios4-common.nagios4.init cnt=`expr "$cnt" + 1` if [ "$cnt" -gt 15 ]; then kill -9 `pidof nagios4` break fi path: nagios4_4.4.6-4.1/debian/nagios4-common.nagios4.init killproc -p $THEPIDFILE ret=$? if [ `pidof nagios4 | wc -l ` -gt 0 ]; then echo -n "Waiting for $NAME daemon to die.." cnt=0 path: nagios4_4.4.6-4.1/debian/nagios4-common.nagios4.init echo -n "Waiting for $NAME daemon to die.." cnt=0 while [ `pidof nagios4 | wc -l ` -gt 0 ]; do cnt=`expr "$cnt" + 1` if [ "$cnt" -gt 15 ]; then