Nginx does not re-open log files on SIGUSR1.

Gena Makhomed gmm at csdoc.com
Mon Jan 3 19:02:02 MSK 2011


On 03.01.2011 15:56, John Feuerstein wrote:

> Is there a reason why every script or suggestion I see floating around
> the net still does it "the hard way" (and I wonder, even on _this_
> mailing list):
>
>    $ kill -USR1 `cat /var/run/nginx.pid`
>    $ pkill -USR1 -f ^nginx:.*master.*process
>
> instead of simply using nginx's built-in way to do this:
>
>    $ nginx -s reopen
>

kill -USR1 `cat /var/run/nginx.pid`

works faster then nginx -s reopen

and also

kill -USR1 `cat /var/run/nginx.pid`

has explicitly defined syntax and behavior.

> It should also work fine if using multiple nginx instances, just pass
> the path to the configuration file of the specific instance with -c.

in many cases nginx config can be very big, with thousands of includes.

nginx -s reopen feature was added for windows version of nginx, AFAIK.

-- 
Best regards,
  Gena



More information about the nginx mailing list