From 0729079712be64f9fdf1747db27061a90f32c267 Mon Sep 17 00:00:00 2001 From: Donnie Barnes Date: Tue, 16 Sep 1997 18:44:19 +0000 Subject: changed status() to be more intelligent wrt programs that change argv[0] --- initscripts-3.12.spec | 7 +++++++ rc.d/init.d/functions | 12 +++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/initscripts-3.12.spec b/initscripts-3.12.spec index 6d39a1c9..dccabbb0 100644 --- a/initscripts-3.12.spec +++ b/initscripts-3.12.spec @@ -15,6 +15,13 @@ that activate and deactivate most network interfaces. %changelog + +* Tue Sep 16 1997 Donnie Barnes + +- reworked status() to adjust for processes that change their argv[0] in + the process table. The process must still have it's "name" in the argv[0] + string (ala sendmail: blah blah). + * Mon Sep 15 1997 Erik Troan - fixed bug in FORWARD_IPV4 support diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions index e3b1494e..b9342390 100755 --- a/rc.d/init.d/functions +++ b/rc.d/init.d/functions @@ -62,10 +62,10 @@ killproc() { if [ "$notset" = 1 ] ; then # TERM first, then KILL if not dead kill -TERM $pid - usleep 10000 + usleep 100000 dead=`ps aux | awk "{print $2}" | grep $pid` if [ "$dead" != "" ]; then - sleep 4 + sleep 3 kill -KILL $pid fi # use specified level only @@ -117,8 +117,14 @@ status() { # First try "pidof" pid=`pidof $1` if [ "$pid" != "" ] ; then - echo "$1 is running..." + echo "$1 (pid $pid) is running..." return 0 + else + pid=`ps auxww | grep $1 | egrep -v grep\|$0 | awk '{print $2}'` + if [ "$pid" != "" ] ; then + echo "$1 (pid $pid) is running..." + return 0 + fi fi # Next try "/var/run/*.pid" files -- cgit