Bug 154 - /etc/logrotate.d/apache should not kill -HUP
Summary: /etc/logrotate.d/apache should not kill -HUP
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: apache
Version: 5.2
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Preston Brown
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 1998-11-22 14:48 UTC by magnus
Modified: 2008-05-01 15:37 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 1998-12-16 17:21:00 UTC
Embargoed:


Attachments (Terms of Use)

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.


Note You need to log in before you can comment on or make changes to this bug.