diff options
author | Bill Nottingham <notting@redhat.com> | 2006-11-20 21:16:12 +0000 |
---|---|---|
committer | Bill Nottingham <notting@redhat.com> | 2006-11-20 21:16:12 +0000 |
commit | 43e14799e6f78e45b990e447d1f204eb2eea238d (patch) | |
tree | 2373a13e7bbfb865d3a0e5bd7dacb431a559fa2d | |
parent | 7727a99c2300846d76df3ca10e06138e68780db5 (diff) | |
download | initscripts-43e14799e6f78e45b990e447d1f204eb2eea238d.tar initscripts-43e14799e6f78e45b990e447d1f204eb2eea238d.tar.gz initscripts-43e14799e6f78e45b990e447d1f204eb2eea238d.tar.bz2 initscripts-43e14799e6f78e45b990e447d1f204eb2eea238d.tar.xz initscripts-43e14799e6f78e45b990e447d1f204eb2eea238d.zip |
- init.d/functions: add configurable delay for killproc (#198468,
<jorton@redhat.com>)
-rw-r--r-- | initscripts.spec | 1 | ||||
-rwxr-xr-x | rc.d/init.d/functions | 10 |
2 files changed, 8 insertions, 3 deletions
diff --git a/initscripts.spec b/initscripts.spec index 86278da8..633b25a1 100644 --- a/initscripts.spec +++ b/initscripts.spec @@ -211,6 +211,7 @@ rm -rf $RPM_BUILD_ROOT present (#150769) - netfs: call multipath, kpartx if necessary (#180977) - rc.sysinit: run zfcpconf.sh earlier, so devices are available for LVM usage (#189494) +- init.d/functions: add configurable delay for killproc (#198468, <jorton@redhat.com>) * Fri Apr 21 2006 Miloslav Trmac <mitr@redhat.com> - 7.93.25.EL-1 - Document HOTPLUG (#189509) diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions index 04d86d2b..765258c3 100755 --- a/rc.d/init.d/functions +++ b/rc.d/init.d/functions @@ -154,12 +154,16 @@ daemon() { # A function to stop a program. killproc() { - RC=0 + RC=0; delay=3 # Test syntax. if [ "$#" -eq 0 ]; then - echo $"Usage: killproc {program} [signal]" + echo $"Usage: killproc [ -d delay] {program} [signal]" return 1 fi + if [ "$1" = "-d" ]; then + delay=$2 + shift 2 + fi notset=0 # check for second arg to be kill level @@ -196,7 +200,7 @@ killproc() { kill -TERM $pid >/dev/null 2>&1 usleep 100000 if checkpid $pid && sleep 1 && - checkpid $pid && sleep 3 && + checkpid $pid && sleep $delay && checkpid $pid ; then kill -KILL $pid >/dev/null 2>&1 usleep 100000 |