Bug 154 - /etc/logrotate.d/apache should not kill -HUP
/etc/logrotate.d/apache should not kill -HUP
Product: Red Hat Linux
Classification: Retired
Component: apache (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Preston Brown
Depends On:
  Show dependency treegraph
Reported: 1998-11-22 09:48 EST by magnus
Modified: 2008-05-01 11:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 1998-12-16 12:21:00 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description magnus 1998-11-22 09:48:40 EST
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 02:39:59 EST
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
Comment 2 Preston Brown 1998-12-16 12:21:59 EST
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.