Geek article: when logrotate kills your apache
Ok folks, I normally do not want to get to technical in this blog, but I have searched for hours until I found the solution to one of the more serious problems we had in the last days.
Tradebit now has literally hundreds of requests per minute on the servers, even in the early morning. But in that early morning, we rotate our logfiles away to keep them small and nice.
Now every second or third day, the webserver tried to restart and move the logs away. Bad enough, it did not come back after starting the rotation process.
I found the logrotation details in /etc/logrotate.d/httpd on Red Hat Linux, you may look elsewhere, if you have another distribution.
The solution to that problem is, that you might restart the server with the “-HUP” signal right now, which means that your webserver will wait until all its children have exited and the main process will start again.
If a customer was downloading from that particular webserver, the system waited and did not accept new connections…
We have now changed the “-HUP” to “-USR1″, which is like a graceful restart and NOT freezing the system on a server restart.
I truly hope that helps other sysadmins, who have the same problems on Linux.



February 20th, 2006 at 2:25 pm
Thanks!
Logrotate on my system kills some other daemons and now I understand why
BM