Bug 9610 - killall -HUP and daemon restarting
Summary: killall -HUP and daemon restarting
Keywords:
Status: CLOSED DEFERRED
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: apache
Version: 6.2
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Nalin Dahyabhai
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-02-20 19:08 UTC by mal
Modified: 2008-05-01 15:37 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2000-02-29 18:05:00 UTC
Embargoed:


Attachments (Terms of Use)

Description mal 2000-02-20 19:08:27 UTC
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 16:25:59 UTC
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 17:18:59 UTC
>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 18:05:59 UTC
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.