3 messages in ru.sysoev.nginxRe: Logrotating the log files
FromSent OnAttachments
Jeremy HubertJan 19, 2007 9:20 pm 
Igor SysoevJan 20, 2007 12:07 am 
José ParrellaJan 20, 2007 3:41 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: Logrotating the log filesActions...
From:Igor Sysoev (is-G@public.gmane.org)
Date:Jan 20, 2007 12:07:00 am
List:ru.sysoev.nginx

On Fri, 19 Jan 2007, Jeremy Hubert wrote:

I'm trying to setup logrotate to automatically rotate the log files every night at midnight.

When they rotate though, nginx doesn't log to the new logfile anymore until I restart the server.. but I'm having a hard time restarting the server from the logrotate config file because of sudo permissions.

So.. any tips? Has anyone else done this?

The rotator should send the -USR1 signal to the master process. The master process reopens files, does chown() and chmod() to enable the worker processes to write to files, and send a notification to the worker procesess. They reopen files instantly.

If the rotator sends the -HUP signal, then them master does a reconfiguration and starts a new worker processes those write to the new log files, but the old shuting down worker processes still uses the old log files.

Any way, to send the -USR1 signal you should have the sudo permission.