diff options
author | Bill Nottingham <notting@redhat.com> | 1999-03-30 22:43:04 +0000 |
---|---|---|
committer | Bill Nottingham <notting@redhat.com> | 1999-03-30 22:43:04 +0000 |
commit | 27588a903d0e6fd4ad79d57e5c47095842335c0e (patch) | |
tree | 5e53b162bf7d13a8b3ec3b2eb7b786141335e8eb /rc.d | |
parent | 90d452b1b91147a30f982549a14d48856c823797 (diff) | |
download | initscripts-27588a903d0e6fd4ad79d57e5c47095842335c0e.tar initscripts-27588a903d0e6fd4ad79d57e5c47095842335c0e.tar.gz initscripts-27588a903d0e6fd4ad79d57e5c47095842335c0e.tar.bz2 initscripts-27588a903d0e6fd4ad79d57e5c47095842335c0e.tar.xz initscripts-27588a903d0e6fd4ad79d57e5c47095842335c0e.zip |
fix for pid grep in status
Diffstat (limited to 'rc.d')
-rwxr-xr-x | rc.d/init.d/functions | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions index d15f19a0..f22f4941 100755 --- a/rc.d/init.d/functions +++ b/rc.d/init.d/functions @@ -171,7 +171,10 @@ status() { echo "$1 (pid $pid) is running..." return 0 else - pid=`ps auxww Op | awk '{ if ($12 ~ /^[^[]'"$1"'/) print $2}'` + pid=`ps ax | awk 'BEGIN { prog=ARGV[1]; ARGC=1 } + { if ((prog == $5) || (("(" prog ")") == $5) || + (("[" prog "]") == $5) || + ((prog ":") == $5)) { print $1 ; exit 0 } }' $1` if [ "$pid" != "" ] ; then echo "$1 (pid $pid) is running..." return 0 |