From 9230e126aa86e2fd7a93dd8ded31f3a6513fb9b6 Mon Sep 17 00:00:00 2001 From: Donnie Barnes Date: Tue, 16 Sep 1997 19:55:20 +0000 Subject: changed the order of the check for process Id...first is /var/run/pid and the second is pidof. --- rc.d/init.d/functions | 16 ++++++++-------- 1 file 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) || -- cgit v1.2.1