RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 970041 - RFE: ExecRestartPre or similar
Summary: RFE: ExecRestartPre or similar
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: systemd
Version: 7.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: rc
: ---
Assignee: systemd-maint
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks: 969972
TreeView+ depends on / blocked
 
Reported: 2013-06-03 11:18 UTC by Joe Orton
Modified: 2014-06-13 11:55 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-06-13 11:55:22 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Joe Orton 2013-06-03 11:18:39 UTC
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 13:05:23 UTC
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 14:02:28 UTC
(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 15:05:11 UTC
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 15:05:55 UTC
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 11:07:57 UTC
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 Program Management 2014-03-22 06:47:38 UTC
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.