Bug 113935 - init.d script kills httpd via killproc, not via kill $pidfile
init.d script kills httpd via killproc, not via kill $pidfile
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: httpd (Show other bugs)
3.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Joe Orton
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-01-20 08:04 EST by Stefan Leuchsenring
Modified: 2007-11-30 17:07 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-02-17 09:26:41 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 Stefan Leuchsenring 2004-01-20 08:04:03 EST
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)

Description of problem:
The init.d script /etc/init.d/httpd kills the httpd daemon via

  killproc $httpd

If I run multiple httpd daemons a

  /etc/init.d/httpd stop

kills every apache webserver.



Version-Release number of selected component (if applicable):
httpd-2.0.46-25.ent

How reproducible:
Always

Steps to Reproduce:
Patch /etc/init.d/httpd:

64c64
<       killproc $httpd
---
>       kill `cat /var/run/httpd.pid`

Additional info:
Comment 1 Joe Orton 2004-01-20 08:21:45 EST
The current behaviour should be as follows:

- if /var/run/httpd.pid exists, "service httpd stop" will kill only
the PID stored in that file

- otherwise, "service httpd stop" kills all processes named "httpd"

Do you see behaviour different to that?
Comment 2 Dmitry S. Makovey 2005-05-19 17:36:36 EDT
(In reply to comment #1)
> The current behaviour should be as follows:
> 
> - if /var/run/httpd.pid exists, "service httpd stop" will kill only
> the PID stored in that file
> 
> - otherwise, "service httpd stop" kills all processes named "httpd"

That is actually improper behaviour. If there's no .pid file than "service httpd
stop" should fail in case of multiple instances. 

We run jailed environments which are replicas of host system. Which in turn
means we have multiple "httpd" running from different jails and just shooting
processes left and righ is not an option. There are other cases when this is not
applicable: on some machines we run multiple instances without jailed
environment and problems like bug #114619 plus #113935 make our lifes much
harder then they should be; etc.

Hope you will consider re-opening this bug and providing fix for the problem.
Even using plain "apachectl stop" instead of "killproc $httpd" fixes the problem.
Comment 3 Troels Arvin 2006-03-24 02:46:08 EST
We (using RHEL 4) would also very much like Red Hat to add support for having
several instances of httpd (with different configurations) running. As stated,
the most important aspect of this is that the init-script should (only) look in
the pid-file, and at no time send kill-signals all httpd instances. Also, the
OPTIONS environment in the init-script should be exported, so that apachectl
will work with correct parameters, e.g. pick up the right "-f
/etc/httpd/conf/FOO.conf" parameter for configtests, etc.

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