Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

2
  • Re: there's nothing wrong. Daemons should really open either "/dev/null" or a logger on file descriptors 1 and 2 before execve'ing other programs. Otherwise, you may end up with log output on data files. Bear in mind that even if the program doesn't appear to output anything to std{out,err}, libraries may. Even glibc can output to stderr if LIBC_FATAL_STDERR_ is set ot if it cannot open "/dev/tty". Commented Nov 11, 2013 at 16:43
  • @ninjalj On fd 2, yes. But on fd 0, I don't see any reason. Any file opened by a daemon should be closed before executing an unrelated process regardless of the descriptor. Commented Nov 11, 2013 at 22:09