From 98bf82e8139255e33edfc7270146b4be9f74a2d4 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Wed, 13 Mar 2002 07:29:44 +0000 Subject: add --force to daemon() (needed for LSB) --- rc.d/init.d/functions | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions index 44446c42..d025f674 100755 --- a/rc.d/init.d/functions +++ b/rc.d/init.d/functions @@ -85,7 +85,7 @@ checkpid() { # A function to start a program. daemon() { # Test syntax. - local gotbase= + local gotbase= force= local base= user= nice= bg= pid nicelevel=0 while [ "$1" != "${1##[-+]}" ]; do @@ -110,6 +110,10 @@ daemon() { user=${1#--user=} shift ;; + --force) + force="force" + shift + ;; [-+][0-9]*) nice="nice -n $1" shift @@ -125,7 +129,7 @@ daemon() { # See if it's already running. Look *only* at the pid file. pid=`pidfileofproc $base` - [ -n "${pid:-}" ] && return + [ -n "${pid:-}" -a -z "${force:-}" ] && return # make sure it doesn't core dump anywhere; while this could mask # problems with the daemon, it also closes some security problems -- cgit v1.2.1