Home
Reading
Searching
Subscribe
Sponsors
Statistics
Posting
Contact
Spam
Lists
Links
About
Hosting
Filtering
Features Download
Marketing
Archives
FAQ
Blog
 
Gmane
From: Igor Sysoev <is-G97k7egY2jIKNkxEY4oc4w <at> public.gmane.org>
Subject: Re: Logrotating the log files
Newsgroups: gmane.comp.web.nginx.english
Date: Saturday 20th January 2007 08:07:23 UTC (over 10 years ago)
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.


Igor Sysoev
http://sysoev.ru/en/
 
CD: 3ms