Red Hat Bugzilla – Bug 9610
killall -HUP and daemon restarting
Last modified: 2008-05-01 11:37:54 EDT
a number of killall -HUP program_name
to restart a daemon
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
if [check if server is running ]; then
# This script is symlik to apachectl
# from apache distribution. Original RedHat script has some other problems.
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.
>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
"kill -HUP `cat pid_file.pid`"
should be used instead of killall -HUP program_name.
You're correct. I'll make sure this gets added to the to-do list
for the next release.