]> git.pld-linux.org Git - projects/rc-scripts.git/blobdiff - lib/functions
daemon ssd mode: always setsid, so programs that properly don't daemonize get detache...
[projects/rc-scripts.git] / lib / functions
index de386b98037551cd77f6252228396256bc340cec..aee3cc1fff66dddf06e08dbcd3f12c5690132895 100644 (file)
@@ -752,6 +752,12 @@ daemon() {
                        fi
                        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
+
                        /sbin/start-stop-daemon -q --start \
                                --nicelevel $nice \
                                ${pidfile:+--pidfile $pidfile} \
This page took 0.142264 seconds and 4 git commands to generate.