aboutsummaryrefslogtreecommitdiffstats
path: root/rc.d/init.d/functions
diff options
context:
space:
mode:
Diffstat (limited to 'rc.d/init.d/functions')
-rwxr-xr-xrc.d/init.d/functions19
1 files changed, 2 insertions, 17 deletions
diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions
index 18cdceef..3dfde002 100755
--- a/rc.d/init.d/functions
+++ b/rc.d/init.d/functions
@@ -170,17 +170,11 @@ pidofproc() {
fi
# Next try "pidof"
- pid=`pidof $1`
+ pid=`pidof -x $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() {
@@ -191,19 +185,10 @@ status() {
fi
# First try "pidof"
- pid=`pidof $1`
+ pid=`pidof -x $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