NOTE: setsid needs to be "outer" program
otherwise start-stop-daemon would capture the setsid pid not the actual program
as for RC_LOGGING=yes, this was already executed in this order:
setsid makepid program arguments
set -- "$prog" "$@"
# use setsid to detach from terminal,
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
/sbin/start-stop-daemon -q --start \
--nicelevel $nice \
${pidfile:+--pidfile $pidfile} \
/sbin/start-stop-daemon -q --start \
--nicelevel $nice \
${pidfile:+--pidfile $pidfile} \