aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDonnie Barnes <djb@redhat.com>1997-09-16 18:44:19 +0000
committerDonnie Barnes <djb@redhat.com>1997-09-16 18:44:19 +0000
commit0729079712be64f9fdf1747db27061a90f32c267 (patch)
treef22d80b4e23b80fe3301700bef503b31b9b1ce4f
parent2371f5e29eebbd71c2970998dabbfaf500d59a3c (diff)
downloadinitscripts-0729079712be64f9fdf1747db27061a90f32c267.tar
initscripts-0729079712be64f9fdf1747db27061a90f32c267.tar.gz
initscripts-0729079712be64f9fdf1747db27061a90f32c267.tar.bz2
initscripts-0729079712be64f9fdf1747db27061a90f32c267.tar.xz
initscripts-0729079712be64f9fdf1747db27061a90f32c267.zip
changed status() to be more intelligent wrt programs that change argv[0]
-rw-r--r--initscripts-3.12.spec7
-rwxr-xr-xrc.d/init.d/functions12
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 <djb@redhat.com>
+
+- 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 <ewt@redhat.com>
- 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