On Fri, 18 Feb 2005, Covington, Chris wrote:

> Hi all,
>
> Whenever I do a logrotate, it seems my apache2 stops logging though
> there are new log files created but with 0 size.  I'm using syslog-ng if
> it matters.
>
> I have the following logrotate configuration for apache2 (the prerotate
> scp works without prompting because I've exchanged keys):
>
> /var/log/apache2/*log {
>         rotate 28
>         daily
>         prerotate
>                 /usr/bin/scp /var/log/apache2/access_log
> grettir:/var/log/videodrome
>         postrotate
>                 /bin/kill -USR1 `cat /var/run/apache2.pid 2>/dev/null`
> 2> /dev/null || true
>         endscript
> }
>
> The above postrotate action I've ripped from a Red Hat system which
> successfully logrotates but it didn't make any difference.
> I've tried replacing the postrotate with /etc/init.d/apache2 restart and
> I've also tried editing /etc/conf.d/apache2 to use "restart" instead of
> "graceful" to no avail.  I've also tried adding         missingok
> notifempty create 0644 root root and sharedscripts but it doesn't make a
> difference.
>
> If I manually do a /etc/init.d/apache2 restart the logging resumes.
>
> What can I do?

Instead of using that kill line in postrotate (which, based upon a
perusal of the apache2 and apache2ctl manpages, appears to be
deprecated), invoke /etc/init.d/apache2 restart.

Editing /etc/conf.d/apache2 may do nothing if you're working directly
under the covers as you are above.

Incidentally, I believe the problem may be that you're doing a graceful
restart, which does not necessarily close the log files immediately
(and, if the system is busy, probably does not.)


So, um, this prerotate thing you do - you're copying the log file before
it is static?  You realize that you may not get the full log file that
way, right?

Ed
--
[email protected] mailing list

Reply via email to