aboutsummaryrefslogtreecommitdiffstats
path: root/rc.d/init.d
diff options
context:
space:
mode:
Diffstat (limited to 'rc.d/init.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