There are several questions about this already but none of them seem to work. I have a production system that is currently down and I need to be able to get the stderr output from the daemon quickly to debug it.
I thought I could just redirect the output from the point it is called (in an init.d script) but it is proving extremely difficult.
start-stop-daemon -d $DDIR -b -m --start --quiet -pidfile $PIDFILE --exec $DAEMON -- \
$DAEMON_ARGS > /var/log/daemon.log 2>&1 \
|| return 2
This does not work. I tried running a shell script that calls the executable and redirects the output but still the log file remained empty (and I do know that the process is outputting information).
Any help would be extremely appreciated.