Bug 970041 - RFE: ExecRestartPre or similar
RFE: ExecRestartPre or similar
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: systemd (Show other bugs)
7.0
Unspecified Unspecified
high Severity high
: rc
: ---
Assigned To: systemd-maint
qe-baseos-daemons
: FutureFeature
Depends On:
Blocks: 969972
  Show dependency treegraph
 
Reported: 2013-06-03 07:18 EDT by Joe Orton
Modified: 2014-06-13 07:55 EDT (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-06-13 07:55:22 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 Joe Orton 2013-06-03 07:18:39 EDT
Description of problem:
We're still finding cases where systemd integration for httpd is not producing optimal behaviour.  One such case is restart/stop handling.

Say the service is running, the user changes the configuration and runs
"systemctl restart httpd.service".  Ideally that command should fail without changing the state of the running service.  To implement this we really need an ExecRestartPre or something which works like ExecStartPre for restart. 

Version-Release number of selected component (if applicable):
systemd-204-4.el7.x86_64

How reproducible:


Steps to Reproduce:
1. systemctl start httpd
2. echo FOO > /etc/httpd/conf.d/foo.conf
3. systemctl restart httpd

Actual results:
a) if we use an ExecStop in httpd.service which checks the config and returns an error, this triggers service-stop timeout handling and is ugly
b) if we omit ExecStop it just kills the daemon

Expected results:
"systemctl restart" command returns immediately with failure

Additional info:
Comment 2 Joe Orton 2013-09-03 09:05:23 EDT
We really need this or something like this to fix bug 969972, otherwise we are going to ship with awkward systemd integration in RHEL7.  Is this feasible?
Comment 3 Harald Hoyer 2013-09-03 10:02:28 EDT
(In reply to Joe Orton from comment #2)
> We really need this or something like this to fix bug 969972, otherwise we
> are going to ship with awkward systemd integration in RHEL7.  Is this
> feasible?

isn't what the user wants a "reload" ?

# systemctl reload httpd

??
Comment 4 Joe Orton 2013-10-22 11:05:11 EDT
Not sure what you mean by "what the user wants".

Reload works fine here, but we also want good behaviour for *this* case ("restart" or "stop" in the presence of a config error).
Comment 5 Karel Srot 2013-10-22 11:05:55 EDT
The bug appears also with service httpd stop, confirmed on 20131018.0 compose
Raising the priority to high since it causes issues with httpd testing.
Comment 10 Lukáš Nykrýn 2013-11-14 06:07:57 EST
I am not sure what is scope of this bug anymore. systemctl restart should do stop and start of a service and I am pretty convinced that this should be done even if the configuration file is corrupted. In the case that user wants to reload new configuration he should use systemctl reload (and there apache can ignore it when the configuration is wrong and write something to logs).

And about the hang was not it fixed with https://bugzilla.redhat.com/show_bug.cgi?id=1012795 ?
Comment 11 RHEL Product and Program Management 2014-03-22 02:47:38 EDT
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

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