]> git.pld-linux.org Git - projects/rc-scripts.git/commitdiff
daemon: makepid implies fork
authorElan Ruusamäe <glen@delfi.ee>
Thu, 8 Oct 2015 15:12:48 +0000 (18:12 +0300)
committerElan Ruusamäe <glen@delfi.ee>
Thu, 8 Oct 2015 15:12:48 +0000 (18:12 +0300)
lib/functions

index ca08dbe100799640aad0be6e9d2cd953e381fc60..8d018f7120497e270050e861c80ba3dbf4613b2b 100644 (file)
@@ -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
This page took 0.104277 seconds and 4 git commands to generate.