Bug 20256

Summary: logrotate sends a HUP to all Apache httpds.
Product: [Retired] Red Hat Linux Reporter: Ralph Corderoy <ralph-fedora453>
Component: logrotateAssignee: Erik Troan <ewt>
Status: CLOSED CURRENTRELEASE QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.1CC: pekkas, ralph-fedora453
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-11-02 22:54:56 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ralph Corderoy 2000-11-02 22:54:54 UTC
Hi,

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 <fanf>
Subject: Re: documentation/6767: Affect of HUP on Child Processes Not
Documented.
To:      apbugs
Date:    Thu, 2 Nov 2000 18:36:58 +0000

Ralph Corderoy <ralph.co.uk> 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.

Tony.

Comment 1 Pekka Savola 2000-11-04 10:55:31 UTC
This has been fixed in RHL 7.0:

/var/log/httpd/access_log {
    missingok
    postrotate
        /bin/kill -HUP `cat /var/run/httpd.pid 2>/dev/null` 2> /dev/null || true
    endscript
}

However, the signal should be USR1 not HUP.  That's another issue though.