Bug 674706 - "service httpd stop" stops all httpd processes, even if they weren't started with "service httpd start"
Summary: "service httpd stop" stops all httpd processes, even if they weren't started ...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: httpd
Version: 4.9
Hardware: All
OS: Linux
high
high
Target Milestone: rc
: ---
Assignee: Joe Orton
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-02-03 00:15 UTC by Bryan Mason
Modified: 2018-11-14 14:55 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-04-30 19:18:38 UTC
Target Upstream Version:


Attachments (Terms of Use)
Proposed Patch (730 bytes, patch)
2011-02-03 00:22 UTC, Bryan Mason
no flags Details | Diff

Description Bryan Mason 2011-02-03 00:15:57 UTC
Description of problem:

    While httpd service is not running, stopping/reloading the service
    kills all processes which names are httpd.

Version-Release number of selected component (if applicable):

    httpd-2.0.52-41.ent.4

How reproducible:

    100%

Steps to Reproduce:

 1. Stop httpd ("service httpd stop")
 2. Start an httpd daemon but don't start the service ("./httpd &")
 3. Stop the httpd service ("service httpd stop")
  
Actual results:

    The daemons started in step #2 above will be stopped.

Expected results:

    Processes not started as part of the service should not be stopped.

Additional info:

    This was originally reported as part of Bug 512221 (which reported
    a couple of different issues), but was inadvertently overlooked.

Comment 2 Bryan Mason 2011-02-03 00:22:13 UTC
Created attachment 476686 [details]
Proposed Patch

Comment 4 Joe Orton 2011-02-22 11:19:19 UTC
Yes, the patch would work around the issue, although it would cause the init script to return without an error.

A side-effect of the current behaviour is that the "stop" script will work as expected if "PidFile" is changed in the httpd configuration but not in the sysconfig file.  It is possible that customers rely on the current behaviour, and that changing it will break working (if not exactly correct) configurations.

At this stage in the RHEL 4 lifecycle I think it would be unwise to make this type of change to the httpd package.  It would also be undesirable to make a change to the RHEL 4 package which does not mirror the current (correct) behaviour of RHEL 5/6.

If the customer is unable to work around this issue outside of the httpd init script, we could possibly add some conditional variable to the init script to allow the desired behaviour.

So something like:

  if [ x"${FORCE_PIDFILE_CHECK}" = "xy" -a ! -f "${pidfile}" ]; then
      return
  fi

in place of the one-line test for pid-file existence; only if FORCE_PIDFILE_CHECK is set in the sysconfig file, would the change take effect.


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