]> git.pld-linux.org Git - projects/rc-scripts.git/blobdiff - lib/functions
fix RC_LOGGING=no daemon --makepid --fork write proper pidfile
[projects/rc-scripts.git] / lib / functions
index 2b2e3a1d637d9ab04dd12a2d755dcdfe307e32d2..74f4c95a2f6f6b3e33e6f170d07cfe2fdd2644cf 100644 (file)
@@ -673,12 +673,11 @@ _daemon_exec() {
                set -- "$prog" "$@"
 
                # use setsid to detach from terminal,
-               # needs pidfile or ssd would check setsid program instead of real program
-               if [ "$pidfile" ]; then
-                       set -- /usr/bin/setsid "$@"
-               fi
+               # NOTE: setsid needs to be "outer" program
+               # otherwise start-stop-daemon would capture the setsid pid not the actual program
 
                prog=$1; shift
+               /usr/bin/setsid \
                /sbin/start-stop-daemon -q --start \
                        --nicelevel $nice \
                        ${pidfile:+--pidfile $pidfile} \
This page took 0.043209 seconds and 4 git commands to generate.