In this context the word daemon
means just, that after forking the parent-process exits. So, if the newly created daemon still logs data on STDOUT
respectively STDERR
redirection should work as you would expect in the non-daemon case.
If motion
closes STDOUT
and STDERR
after forking you have no chance to log anything (motion
have to) since nothing can be written by motion
to STDOUT
or STDERR
anylonger.
If the execution of motion
and motion -magicdaemonswitch
only differs in the way that with -magicdaemonswitch
a fork is made. You should be fine to start motion
with
motion > log.txt &
stdout
orstderr
but there is absolutely no necessity for the daemon to do so.