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 | |
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
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | initscripts.spec | 8 | ||||
-rwxr-xr-x | rc.d/init.d/functions | 11 |
3 files changed, 24 insertions, 4 deletions
@@ -1,3 +1,12 @@ +2001-02-15 Nalin Dahyabhai <nalin@redhat.com> + + * initscripts.spec: 5.64.2-1 + + * rc.d/init.d/functions: + fix killproc, pidofproc, and status looking at or killing the wrong + daemon when they share the same basename but are in different + directories + 2001-02-14 Bill Nottingham <notting@redhat.com> * initscripts.spec: 5.64.1-1 diff --git a/initscripts.spec b/initscripts.spec index d8be812a..02f7fde9 100644 --- a/initscripts.spec +++ b/initscripts.spec @@ -1,6 +1,6 @@ Summary: The inittab file and the /etc/init.d scripts. Name: initscripts -Version: 5.64.1 +Version: 5.64.2 Copyright: GPL Group: System Environment/Base Release: 1 @@ -254,6 +254,12 @@ rm -rf $RPM_BUILD_ROOT %ghost %attr(0664,root,utmp) /var/run/utmp %changelog +* Thu Feb 15 2001 Nalin Dahyabhai <nalin@redhat.com> +- make pidofproc() and killproc() try to use the PID associated with the full + 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 + * Wed Feb 14 2001 Bill Nottingham <notting@redhat.com> - fix init.d/single to work around possible kernel problem 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 |