commit 9ecaca50bfd26e55c7bae36b9c412c05e182cfdb
Author: Elan Ruusamäe <[email protected]>
Date: Sun Mar 2 10:05:39 2014 +0000
daemon ssd mode: always setsid, so programs that properly don't daemonize
get detached from terminal
there will be probably more programs that don't daemonie themselves due
that systemd movement which does all that for programs themselves
lib/functions | 6 ++++++
1 file changed, 6 insertions(+)
---
diff --git a/lib/functions b/lib/functions
index de386b9..aee3cc1 100644
--- a/lib/functions
+++ b/lib/functions
@@ -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} \
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/projects/rc-scripts.git/commitdiff/9ecaca50bfd26e55c7bae36b9c412c05e182cfdb
_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit