summaryrefslogtreecommitdiff
path: root/sh
diff options
context:
space:
mode:
authorChristian Ruppert <idl0r@gentoo.org>2012-01-17 18:23:56 +0100
committerChristian Ruppert <idl0r@gentoo.org>2012-01-17 18:25:44 +0100
commit9c0edc5c527de01cbe2dccbc7f1a2c571b6acc41 (patch)
tree0bfe4211a3b217d3cf4372cc984835f2c191635c /sh
parentd729f9d0f2d773c3cddc2f3004364d831081f692 (diff)
downloadopenrc-9c0edc5c527de01cbe2dccbc7f1a2c571b6acc41.tar.gz
openrc-9c0edc5c527de01cbe2dccbc7f1a2c571b6acc41.tar.bz2
openrc-9c0edc5c527de01cbe2dccbc7f1a2c571b6acc41.tar.xz
Use the "--make-pidfile" when command_background is used
The start-stop-daemon "--make-pidfile" option is now used by default when using command_background, this requires a pidfile to be specified. Document command_background option. Reported-by: Giampaolo Tomassoni <giampaolo@tomassoni.biz> X-Gentoo-Bug: 399165 X-Gentoo-Bug-URL: https://bugs.gentoo.org/399165
Diffstat (limited to 'sh')
-rw-r--r--sh/runscript.sh.in6
1 files changed, 5 insertions, 1 deletions
diff --git a/sh/runscript.sh.in b/sh/runscript.sh.in
index 470f04c..e042be6 100644
--- a/sh/runscript.sh.in
+++ b/sh/runscript.sh.in
@@ -124,7 +124,11 @@ start()
local _background=
ebegin "Starting ${name:-$RC_SVCNAME}"
if yesno "${command_background}"; then
- _background="--background --pidfile"
+ if [ -z "${pidfile}" ]; then
+ eend 1 "command_background option used but no pidfile specified"
+ return 1
+ fi
+ _background="--background --make-pidfile --pidfile"
fi
if yesno "$start_inactive"; then
local _inactive=false