Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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

What I am trying to do: Log rotate nginx access and error log using multilog

My approach: Log nginx access and error to a pipe, so I can have another process that runs multilog that reads from that pipe and let multilog to do the log rotation


access_log /var/log/nginx/access/pipe;
error_log /var/log/nginx/access/pipe;

I make sure I created the pipe and give enough permission to whoever to do anything with it

$ sudo mkfifo /var/log/nginx/access/pipe /var/log/nginx/error/pipe
$ sudo chmod a+rwx /var/log/nginx/access/pipe /var/log/nginx/error/pipe

However, when I start nginx, it will hang as if it is waiting for stdin or something. I might be missing something here.

I tried simple echo to the pipe

$ echo a > /var/log/nginx/access/pipe

and it also hangs as if it is waiting for more input. Mayb

share|improve this question
Did you edit the init script to start multilog before the Nginx? – quanta Aug 8 '12 at 8:29

I think multilog needs to be listening to the pipes before you start Nginx.

share|improve this answer

this project solves it by properly binding svlogd and nginx semantics, it has a chargen program that simulate nginx behaviour, a stress test and a runit/runsv/svlogd integration example

project tagline: nginx log rotation with daemontools/runit (multilog/svlogd respectively)

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.