diff options
author | Donnie Barnes <djb@redhat.com> | 1997-09-16 18:44:19 +0000 |
---|---|---|
committer | Donnie Barnes <djb@redhat.com> | 1997-09-16 18:44:19 +0000 |
commit | 0729079712be64f9fdf1747db27061a90f32c267 (patch) | |
tree | f22d80b4e23b80fe3301700bef503b31b9b1ce4f /rc.d/init.d | |
parent | 2371f5e29eebbd71c2970998dabbfaf500d59a3c (diff) | |
download | initscripts-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]
Diffstat (limited to 'rc.d/init.d')
-rwxr-xr-x | rc.d/init.d/functions | 12 |
1 files changed, 9 insertions, 3 deletions
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 |