aboutsummaryrefslogtreecommitdiffstats
path: root/rc.d/init.d/functions
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2006-07-20 15:52:21 +0000
committerBill Nottingham <notting@redhat.com>2006-07-20 15:52:21 +0000
commit5293e49cac28a9af839cd0df96155b1140172637 (patch)
tree5bbca522c89d30fbe041f3a6f6f866f4324eda6c /rc.d/init.d/functions
parentd418480f27447c8b25e28910a7eb9085db461b2a (diff)
downloadinitscripts-5293e49cac28a9af839cd0df96155b1140172637.tar
initscripts-5293e49cac28a9af839cd0df96155b1140172637.tar.gz
initscripts-5293e49cac28a9af839cd0df96155b1140172637.tar.bz2
initscripts-5293e49cac28a9af839cd0df96155b1140172637.tar.xz
initscripts-5293e49cac28a9af839cd0df96155b1140172637.zip
Add a configurable delay for killproc() (#198429, <jorton@redhat.com>)
Diffstat (limited to 'rc.d/init.d/functions')
-rwxr-xr-xrc.d/init.d/functions13
1 files changed, 9 insertions, 4 deletions
diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions
index f13eca5b..5366b326 100755
--- a/rc.d/init.d/functions
+++ b/rc.d/init.d/functions
@@ -244,18 +244,23 @@ daemon() {
# A function to stop a program.
killproc() {
- local RC killlevel= base pid pid_file=
+ local RC killlevel= base pid pid_file= delay
- RC=0
+ RC=0; delay=3
# Test syntax.
if [ "$#" -eq 0 ]; then
- echo $"Usage: killproc [-p pidfile] {program} [-signal]"
+ echo $"Usage: killproc [-p pidfile] [ -d delay] {program} [-signal]"
return 1
fi
if [ "$1" = "-p" ]; then
pid_file=$2
shift 2
fi
+ if [ "$1" = "-d" ]; then
+ delay=$2
+ shift 2
+ fi
+
# check for second arg to be kill level
[ -n "${2:-}" ] && killlevel=$2
@@ -278,7 +283,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