Bug 9610 - killall -HUP and daemon restarting
killall -HUP and daemon restarting
Status: CLOSED DEFERRED
Product: Red Hat Linux
Classification: Retired
Component: apache (Show other bugs)
6.2
All Linux
medium Severity medium
: ---
: ---
Assigned To: Nalin Dahyabhai
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-02-20 14:08 EST by mal
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:
Environment:
Last Closed: 2000-02-29 13:05:00 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description mal 2000-02-20 14:08:27 EST
Hi,
currently
logrotate uses
a number of killall -HUP program_name
to restart a daemon

see
/etc/logrotate.d/samba
/etc/logrotate.d/apache

etc.

In many cases this may cause a wrong result.
For example in case of a apache
I start several httpd with a different config
httpd -f config_file.conf
And I do not want -HUP be delivered to other httpd servers.

My proposal is to replace
killall -HUP

to

if [check if server is running ]; then
# This script is symlik to apachectl
# from apache distribution. Original RedHat script has some other problems.
/etc/rc/init.d/httpd restart
fi

Vladislav
Comment 1 Nalin Dahyabhai 2000-02-29 11:25:59 EST
I'm not exactly clear on what's going on here.  Having the init script restart
Apache is no more precise than sending the server a SIGHUP.
Comment 2 mal 2000-02-29 12:18:59 EST
>I'm not exactly clear on what's going on here.  Having the init script restart
>Apache is no more precise than sending the server a SIGHUP.

Yes, the signal SIGHUP should be delivered
to the server. The problem is the following:
all RedHat init scripts (including apache one)
and commands in /etc/logrotate.d/* scripts
use killall -HUP program_name
for this finction. This often cause a signal to be
delivered TO A WRONG PROCESS.
It is very often to have a program running with the same
as one of daemons.

The right way to do deliver SIGHUP is to
use pid stored by server instead.
Most of daemons (including samba,httpd and the others)
store process ID in a special file
The command
"kill -HUP `cat pid_file.pid`"
should be used instead of killall -HUP program_name.
Comment 3 Nalin Dahyabhai 2000-02-29 13:05:59 EST
You're correct.  I'll make sure this gets added to the to-do list
for the next release.

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