2

I would like to save the standard output of the program motion in a text file. If I don't use motion in daemon-mode I would simply do it by:

motion > log.txt

But what is the equivalent when I run it in daemon-mode? I cannot specify implicit logging at least according to motion's man page.

1
  • @jordanm What you say is not true. Programs of various sorts can close the stdout or stderr but there is absolutely no necessity for the daemon to do so.
    – Karlson
    Aug 30, 2012 at 13:46

1 Answer 1

-1

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 &

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .