aboutsummaryrefslogtreecommitdiffstats
path: root/rc.d/init.d/functions
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2002-03-13 07:29:44 +0000
committerBill Nottingham <notting@redhat.com>2002-03-13 07:29:44 +0000
commit98bf82e8139255e33edfc7270146b4be9f74a2d4 (patch)
tree24ce3a64a27609b4bdc679378433d359b85f579e /rc.d/init.d/functions
parent517417011c0693d5eda3e756da8285bbda6a21d1 (diff)
downloadinitscripts-98bf82e8139255e33edfc7270146b4be9f74a2d4.tar
initscripts-98bf82e8139255e33edfc7270146b4be9f74a2d4.tar.gz
initscripts-98bf82e8139255e33edfc7270146b4be9f74a2d4.tar.bz2
initscripts-98bf82e8139255e33edfc7270146b4be9f74a2d4.tar.xz
initscripts-98bf82e8139255e33edfc7270146b4be9f74a2d4.zip
add --force to daemon() (needed for LSB)
Diffstat (limited to 'rc.d/init.d/functions')
-rwxr-xr-xrc.d/init.d/functions8
1 files 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