[projects/rc-scripts] daemon: makepid implies fork
glen
glen at pld-linux.org
Sat Oct 10 01:33:02 CEST 2015
commit d35c0b0ad088d7b47a568350e822ec4f679802e6
Author: Elan Ruusamäe <glen at delfi.ee>
Date: Thu Oct 8 18:12:48 2015 +0300
daemon: makepid implies fork
lib/functions | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/lib/functions b/lib/functions
index ca08dbe..8d018f7 100644
--- a/lib/functions
+++ b/lib/functions
@@ -690,6 +690,7 @@ _daemon_exec() {
--exec "$prog" \
-- "$@"
else
+
if [ "$makepid" ] && [ "$pidfile" ]; then
export PIDFILE="$pidfile"
set -- /lib/rc-scripts/makepid "$@"
@@ -708,7 +709,7 @@ _daemon_exec() {
# A function to start a program (now it's useful on read-only filesystem too)
daemon() {
- local errors="" end="" waitname="" waittime=""
+ local errors="" waitname="" waittime=""
local exit_code=0
local nice=$SERVICE_RUN_NICE_LEVEL
local fork user closefds redirfds pidfile makepid chdir=/
@@ -730,7 +731,6 @@ daemon() {
;;
--fork)
fork=1
- end='&'
;;
--chdir)
shift
@@ -761,6 +761,8 @@ daemon() {
;;
--makepid)
makepid=1
+ # makepid implies fork
+ fork=1
;;
-*|+*)
nice=$1
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/projects/rc-scripts.git/commitdiff/1a0c02d0983a76562fa875a1bab45ece246b26a6
More information about the pld-cvs-commit
mailing list