summaryrefslogtreecommitdiffstats
path: root/rc.d
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2006-11-20 21:16:12 +0000
committerBill Nottingham <notting@redhat.com>2006-11-20 21:16:12 +0000
commit43e14799e6f78e45b990e447d1f204eb2eea238d (patch)
tree2373a13e7bbfb865d3a0e5bd7dacb431a559fa2d /rc.d
parent7727a99c2300846d76df3ca10e06138e68780db5 (diff)
downloadinitscripts-43e14799e6f78e45b990e447d1f204eb2eea238d.tar.gz
initscripts-43e14799e6f78e45b990e447d1f204eb2eea238d.tar.xz
initscripts-43e14799e6f78e45b990e447d1f204eb2eea238d.zip
- init.d/functions: add configurable delay for killproc (#198468,
<jorton@redhat.com>)
Diffstat (limited to 'rc.d')
-rwxr-xr-xrc.d/init.d/functions10
1 files changed, 7 insertions, 3 deletions
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