aboutsummaryrefslogtreecommitdiffstats
path: root/rc.d/init.d
diff options
context:
space:
mode:
authorDonnie Barnes <djb@redhat.com>1997-09-16 19:55:20 +0000
committerDonnie Barnes <djb@redhat.com>1997-09-16 19:55:20 +0000
commit9230e126aa86e2fd7a93dd8ded31f3a6513fb9b6 (patch)
tree59e99a5bdb509d1230306a1e2883da685c1a89a6 /rc.d/init.d
parent10379fc45f662dcbcd12696a43f19033911bef6a (diff)
downloadinitscripts-9230e126aa86e2fd7a93dd8ded31f3a6513fb9b6.tar
initscripts-9230e126aa86e2fd7a93dd8ded31f3a6513fb9b6.tar.gz
initscripts-9230e126aa86e2fd7a93dd8ded31f3a6513fb9b6.tar.bz2
initscripts-9230e126aa86e2fd7a93dd8ded31f3a6513fb9b6.tar.xz
initscripts-9230e126aa86e2fd7a93dd8ded31f3a6513fb9b6.zip
changed the order of the check for process Id...first is /var/run/pid
and the second is pidof.
Diffstat (limited to 'rc.d/init.d')
-rwxr-xr-xrc.d/init.d/functions16
1 files changed, 8 insertions, 8 deletions
diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions
index b9342390..1ab13101 100755
--- a/rc.d/init.d/functions
+++ b/rc.d/init.d/functions
@@ -86,14 +86,7 @@ pidofproc() {
return 1
fi
- # First try "pidof"
- pid=`pidof $1`
- if [ "$pid" != "" ] ; then
- echo $pid
- return 0
- fi
-
- # Next try "/var/run/*.pid" files
+ # First try "/var/run/*.pid" files
if [ -f /var/run/$1.pid ] ; then
pid=`head -1 /var/run/$1.pid`
if [ "$pid" != "" ] ; then
@@ -102,6 +95,13 @@ pidofproc() {
fi
fi
+ # Next try "pidof"
+ pid=`pidof $1`
+ if [ "$pid" != "" ] ; then
+ echo $pid
+ return 0
+ fi
+
# Finally try to extract it from ps
ps auxw | awk 'BEGIN { prog=ARGV[1]; ARGC=1 }
{ if ((prog == $11) || (("(" prog ")") == $11) ||