Bug 1248724 - httpd status returns error immediately after start
httpd status returns error immediately after start
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: httpd (Show other bugs)
6.6
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Web Stack Team
BaseOS QE - Apps
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-07-30 13:03 EDT by Stephen Benjamin
Modified: 2015-07-30 14:10 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-07-30 14:10:12 EDT
Type: Bug
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 Stephen Benjamin 2015-07-30 13:03:36 EDT
Description of problem:
Starting the service, and immediately checking its status results in an error.  It appears the lockfile gets created, and there's a tiny window where the pid file isn't there yet.

Version-Release number of selected component (if applicable):
httpd-2.2.15-39.el6.x86_64

How reproducible:
Usually - >90%

Steps to Reproduce:

1. service httpd stop
2. service httpd start; service httpd status

Do note in #2 the commands must happen in rapid succession.

Actual results:

[root@satellite ~]# service httpd stop; service httpd start; service httpd status
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]
httpd dead but subsys locked


Expected results:
service httpd status returns true

Additional info:
A very short sleep resolves the problem


[root@satellite ~]# service httpd stop; service httpd start; sleep 1; service httpd status
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]
httpd (pid  9352) is running...
Comment 2 Joe Orton 2015-07-30 14:10:12 EDT
I'm afraid that is not designed, documented or implemented to be an atomic operation, so yes there are subtle races.  Upgrade to RHEL7, with systemd you get exactly that guarantee.

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