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
nginx.conf
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