aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>1999-03-30 22:43:04 +0000
committerBill Nottingham <notting@redhat.com>1999-03-30 22:43:04 +0000
commit27588a903d0e6fd4ad79d57e5c47095842335c0e (patch)
tree5e53b162bf7d13a8b3ec3b2eb7b786141335e8eb
parent90d452b1b91147a30f982549a14d48856c823797 (diff)
downloadinitscripts-27588a903d0e6fd4ad79d57e5c47095842335c0e.tar
initscripts-27588a903d0e6fd4ad79d57e5c47095842335c0e.tar.gz
initscripts-27588a903d0e6fd4ad79d57e5c47095842335c0e.tar.bz2
initscripts-27588a903d0e6fd4ad79d57e5c47095842335c0e.tar.xz
initscripts-27588a903d0e6fd4ad79d57e5c47095842335c0e.zip
fix for pid grep in status
-rwxr-xr-xrc.d/init.d/functions5
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