[plug] Logrotate Killing Apache

Timothy White weirdit at gmail.com
Sun Oct 23 12:58:19 WST 2005


It seems, that Apache2 can't restart, after it's log have been
rotated, if something is accessing it's log files.

Try to restart Apache2 gives the following...
$ sudo /etc/init.d/apache2 restart
 * Forcing reload of web server  (Apache2)...
apache2: Could not determine the server's fully qualified domain name,
using 127.0.0.1 for ServerName
(98)Address already in use: make_sock: could not bind to address [::]:80
no listening sockets available, shutting down
 *able to open logs                                                      [fail]


If I find out what is accessing the logs files... It appears that pppd is!?!?!
$ sudo lsof +D /var/log/apache2/
COMMAND   PID USER   FD   TYPE DEVICE    SIZE  NODE NAME
pppd    20576 root    6w   REG  254,2     187 16386 /var/log/apache2/error.log
pppd    20576 root    7w   REG  254,2 1719857 16661 /var/log/apache2/access.log

Anyone know why it does, and how to stop it?
I don't really want to use the custom logging 'pipe' with rotatelogs
cause I'd prefer it to all happen with logrotate.

It is really important that pppd can run while logrotate runs, cause
apache runs the modem control application, so that network users can
connect, and disconnect, via the lan. Unfortunately this morning,
while I was not here, logrotate ran while ppp was up, stopping the lan
users from disconnecting. They resolved to the normal method of fixing
my server, rebooting it. It was becoming a ritual for them on sundays,
as logrotate occurs, and suddenly they have no control of the
internet, and can't access the internal web server, they reboot the
machine. I thought I had fixed it, after stopping an unneeded service,
that was accessing the logs, once again, why are things accessing the
logs!?!?!

Tim



More information about the plug mailing list