|Summary:||/etc/logrotate.d/apache should not kill -HUP|
|Product:||[Retired] Red Hat Linux||Reporter:||magnus|
|Component:||apache||Assignee:||Preston Brown <pbrown>|
|Status:||CLOSED CURRENTRELEASE||QA Contact:|
|Fixed In Version:||Doc Type:||Bug Fix|
|Doc Text:||Story Points:||---|
|Last Closed:||1998-12-16 17:21:00 UTC||Type:||---|
|oVirt Team:||---||RHEL 7.3 requirements from Atomic Host:|
Description magnus 1998-11-22 14:48:40 UTC
The logrotate-file for apache in "/etc/logrotate.d/apache" does a killall -HUP httpd today. It should use apaches apachectl to do a graceful restart with "apachectl graceful". Otherwise a corrupt config-file will make the webserver stop, and also it will break any pending connections. What is worse? Total server down or total logging down? I would very much like to prioritize server uptime before log uptime.
Comment 1 lcantey 1998-12-12 07:39:59 UTC
Actually, killing with a USR1 signal is the prefered way of doing it according to Apache Week: <quoted tip> Rotating log files without killing the transactions in progress Sending the parent Apache process a USR1 signal will make it close the current log files, and re-open them, without loosing any connections currently in progress. This should be used instead of a HUP signal in any log rotation script. The script should first move the current log files to new names (the logs are still open at this stage). Then it should send a USR1 signal to the parent Apache process. The parent will tell the child process to die when they have finished processing their current request, and will open the log files for newly created children (since the old files have been renamed, the opened files will be newly created). As the old children finish their current requests they will close their handle to the (old) log files, and exit. When all the children are dead you can safely process the old log files (for example, by compressing it). Since you cannot know for definite when the old children have all died, the best way to do this is to make your log rotation script sleep for a while after sending the USR1 signal.
Comment 2 Preston Brown 1998-12-16 17:21:59 UTC
This will be corrected in a forthcoming bugfix release of apache.