Red Hat Bugzilla – Bug 20256
logrotate sends a HUP to all Apache httpds.
Last modified: 2007-04-18 12:29:39 EDT
Having entered into discussion with the Apache folks it turns out that they
clearly state that signals should only be sent to the parent process,
not all the child servers. logrotate sends a HUP to all httpds that
are running; this is wrong and gives undefined behaviour.
From: Tony Finch <firstname.lastname@example.org>
Subject: Re: documentation/6767: Affect of HUP on Child Processes Not
Date: Thu, 2 Nov 2000 18:36:58 +0000
Ralph Corderoy <email@example.com> wrote:
>Thanks for the prompt reply.
>Perhaps a warning that the current behaviour is unsupported
>implementation detail would stop Linux distributors, like Red Hat, from
>using `killall -HUP httpd' in their logrotate configuration.
We do: see http://www.apache.org/docs/stopping.html which says:
:You will notice many httpd executables running on your system, but you
:should not send signals to any of them except the parent, whose pid is
:in the PidFile. That is to say you shouldn't ever need to send signals
:to any process except the parent.
I suggest you file a bug with RedHat.
This has been fixed in RHL 7.0:
/bin/kill -HUP `cat /var/run/httpd.pid 2>/dev/null` 2> /dev/null || true
However, the signal should be USR1 not HUP. That's another issue though.