diff options
author | Bill Nottingham <notting@redhat.com> | 2000-01-21 04:58:07 +0000 |
---|---|---|
committer | Bill Nottingham <notting@redhat.com> | 2000-01-21 04:58:07 +0000 |
commit | 7a7946ddfb32d33e0529c4362d8efd76781a4784 (patch) | |
tree | 4c7170d307d02979b381d9833cc1a31e081a51e8 /rc.d/init.d/functions | |
parent | b27ab3341373fbc35d0239e520732b1cc57c8b6b (diff) | |
download | initscripts-7a7946ddfb32d33e0529c4362d8efd76781a4784.tar initscripts-7a7946ddfb32d33e0529c4362d8efd76781a4784.tar.gz initscripts-7a7946ddfb32d33e0529c4362d8efd76781a4784.tar.bz2 initscripts-7a7946ddfb32d33e0529c4362d8efd76781a4784.tar.xz initscripts-7a7946ddfb32d33e0529c4362d8efd76781a4784.zip |
put ps|grep|awk back in until we think of something better (pidof -x ain't it)
Diffstat (limited to 'rc.d/init.d/functions')
-rwxr-xr-x | rc.d/init.d/functions | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions index bd8c3eb8..6f1ce97c 100755 --- a/rc.d/init.d/functions +++ b/rc.d/init.d/functions @@ -183,11 +183,17 @@ pidofproc() { fi # Next try "pidof" - pid=`pidof -x $1` + pid=`pidof $1` if [ "$pid" != "" ] ; then echo $pid return 0 fi + + # Finally try to extract it from ps + ps ax | awk 'BEGIN { prog=ARGV[1]; ARGC=1 } + { if ((prog == $5) || (("(" prog ")") == $5) || + (("[" prog "]") == $5) || + ((prog ":") == $5)) { print $1 ; exit 0 } }' $1 } status() { @@ -198,10 +204,19 @@ status() { fi # First try "pidof" - pid=`pidof -x $1` + pid=`pidof $1` if [ "$pid" != "" ] ; then echo "$1 (pid $pid) is running..." return 0 + else + 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 + fi fi # Next try "/var/run/*.pid" files |