diff options
Diffstat (limited to 'rc.d/init.d/functions')
-rwxr-xr-x | rc.d/init.d/functions | 16 |
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) || |