diff options
author | Nalin Dahyabhai <nalin@redhat.com> | 2001-02-15 15:52:17 +0000 |
---|---|---|
committer | Nalin Dahyabhai <nalin@redhat.com> | 2001-02-15 15:52:17 +0000 |
commit | 83f6eaa0e3224b6c84e356faa016022b53058ebd (patch) | |
tree | 2fbaec569b36050e030dd6cc96172544428cd73f /rc.d/init.d | |
parent | 77ca41b4fcd2e8503795ab18d80db0d998f275de (diff) | |
download | initscripts-83f6eaa0e3224b6c84e356faa016022b53058ebd.tar initscripts-83f6eaa0e3224b6c84e356faa016022b53058ebd.tar.gz initscripts-83f6eaa0e3224b6c84e356faa016022b53058ebd.tar.bz2 initscripts-83f6eaa0e3224b6c84e356faa016022b53058ebd.tar.xz initscripts-83f6eaa0e3224b6c84e356faa016022b53058ebd.zip |
- make pidofproc() and killproc() try to use the PID associated with the fullr5-64-2
pathname first before killing the daemon by its basename (for daemons that
share the same basename, i.e. "master" in postfix and cyrus-imapd) (#19016)
- fix status() as well
Diffstat (limited to 'rc.d/init.d')
-rwxr-xr-x | rc.d/init.d/functions | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions index e1a40d84..b8303f56 100755 --- a/rc.d/init.d/functions +++ b/rc.d/init.d/functions @@ -159,7 +159,10 @@ killproc() { base=${1##*/} # Find pid. - pid=`pidofproc $base` + pid=`pidofproc $1` + if [ -z "$pid" ] ; then + pid=`pidofproc $base` + fi # Kill it. if [ -n "$pid" ] ; then @@ -207,7 +210,7 @@ pidfileofproc() { # Test syntax. if [ $# = 0 ] ; then - echo $"Usage: pidofproc {program}" + echo $"Usage: pidfileofproc {program}" return 1 fi @@ -248,6 +251,7 @@ pidofproc() { fi # Next try "pidof" + pidof -o $$ -o $PPID -o %PPID -x $1 || \ pidof -o $$ -o $PPID -o %PPID -x ${base} } @@ -262,7 +266,8 @@ status() { fi # First try "pidof" - pid=`pidof -o $$ -o $PPID -o %PPID -x ${base}` + pid=`pidof -o $$ -o $PPID -o %PPID -x $1 || \ + pidof -o $$ -o $PPID -o %PPID -x ${base}` if [ "$pid" != "" ] ; then echo $"${base} (pid $pid) is running..." return 0 |