Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

According to the documentation that I could find, daemontools' recommended way to capture stderr (or any other file descriptor) is to redirect it to stdout. If your service has a log/run script, your daemon's stdout will be piped to it.

This obviously means that stderr and stdout are mixed in the output of the logger. Has anyone any experience with capturing stdout and stderr separately in a daemontools-managed process?

share|improve this question

Looks like a shell question to me "How do I send stderr and stdout their separate way?" Assuming bash, or Bourne-ish syntax:

# 3 goes to wherever stdout is pointing
exec 3>&1
# send stdout of this cmd to FD 3, stderr somewhere else
eval $command 2>&1 1>&3 | sed 's/^/stderr from pipe: /'
# close FD 3
exec 3>&-
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.