Sample Header Ad - 728x90

How to redirect a daemon's stdout and stderr using start-stop-daemon(8)?

4 votes
1 answer
5911 views
I run Debian 8 jessie. I have activated a daemon's debugging facility, which causes the daemon to print debugging info to stdout and/or stderr. How can I persuade start-stop-daemon(8), as invoked by /lib/lsb/init-functions, to redirect the daemon's stdout and stderr to my debugging log file /root/log? It appears that >/root/log 2>&1 is ineffective. I suppose that this makes sense, since start-stop-daemon(8) is not a shell. At any rate, how shall I redirect the daemon's stdout and stderr? [The daemon happens to be exim4(8), but this is not relevant to my question as far as I know. LSB evidently delegates the management of the daemon to Systemd; this could be indirectly relevant for all I know.]
Asked by thb (1165 rep)
Oct 1, 2016, 09:10 PM
Last activity: Oct 6, 2016, 07:23 PM