Bug 1362461
| Summary: | 'systemctl status' returns 0 for failed services | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Stanislav Zidek <szidek> |
| Component: | systemd | Assignee: | systemd-maint |
| Status: | CLOSED ERRATA | QA Contact: | Frantisek Sumsal <fsumsal> |
| Severity: | medium | Docs Contact: | Lucie Vařáková <lmanasko> |
| Priority: | high | ||
| Version: | 7.3 | CC: | fsumsal, msekleta, ohudlick, systemd-maint-list |
| Target Milestone: | beta | Keywords: | Regression, TestBlocker |
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | systemd-219-25.el7 | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2016-11-04 00:55:30 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | |||
| Bug Blocks: | 1362179 | ||
|
Description
Stanislav Zidek
2016-08-02 09:11:49 UTC
This got broken with https://github.com/lnykryn/systemd-rhel/commit/41bb37959c96b8fddc13b37384b3453393517f4f Upstream has the same problem: https://github.com/systemd/systemd/issues/3864 Lathough this bug sounds scary, the im pact is quite limited, this is only a problem for services, that have Restart=on-failure and big RestartSec. Those services are not in failed state, because systemd is trying to start them again. Anyway, I have send a patch to upstream to consider such services as PROGRAM_NOT_RUNNING. https://github.com/systemd/systemd/pull/3874 The second version of the patch still waits to be merged in upstream, but setting an optimistic devel_ack for that patch. pushed to staging -> https://github.com/lnykryn/systemd-rhel/commit/94fec84897ab40bf2bc92f0d395a93ecac1b45be -> post Verified on RHEL 7.3 Beta with systemd-219-26.el7.
Old package:
# echo 'AuthenticationMethods garbage' >> /etc/ssh/sshd_config
# systemctl restart sshd
Job for sshd.service failed because the control process exited with error code. See "systemctl status sshd.service" and "journalctl -xe" for details.
# systemctl status sshd
● sshd.service - OpenSSH server daemon
Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Tue 2016-08-16 07:50:09 EDT; 5s ago
Docs: man:sshd(8)
man:sshd_config(5)
Process: 1297 ExecStart=/usr/sbin/sshd $OPTIONS (code=exited, status=255)
Main PID: 907 (code=exited, status=0/SUCCESS)
Aug 16 07:50:09 qeos-178 systemd[1]: sshd.service: control process ex...5
Aug 16 07:50:09 qeos-178 systemd[1]: Failed to start OpenSSH server d....
Aug 16 07:50:09 qeos-178 systemd[1]: Unit sshd.service entered failed....
Aug 16 07:50:09 qeos-178 systemd[1]: sshd.service failed.
Hint: Some lines were ellipsized, use -l to show in full.
# echo $?
0
New package:
# echo 'AuthenticationMethods garbage' >> /etc/ssh/sshd_config
# systemctl restart sshd
Job for sshd.service failed because the control process exited with error code. See "systemctl status sshd.service" and "journalctl -xe" for details.
# systemctl status sshd
● sshd.service - OpenSSH server daemon
Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Tue 2016-08-16 07:46:20 EDT; 10s ago
Docs: man:sshd(8)
man:sshd_config(5)
Process: 4121 ExecStart=/usr/sbin/sshd $OPTIONS (code=exited, status=255)
Main PID: 3829 (code=exited, status=0/SUCCESS)
Aug 16 07:46:20 qeos-176 systemd[1]: sshd.service: control process ex...5
Aug 16 07:46:20 qeos-176 systemd[1]: Failed to start OpenSSH server d....
Aug 16 07:46:20 qeos-176 systemd[1]: Unit sshd.service entered failed....
Aug 16 07:46:20 qeos-176 systemd[1]: sshd.service failed.
Aug 16 07:46:20 qeos-176 sshd[4121]: Unknown authentication method "g...t
Aug 16 07:46:20 qeos-176 sshd[4121]: /etc/ssh/sshd_config line 154: i....
Hint: Some lines were ellipsized, use -l to show in full.
# echo $?
3
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHBA-2016-2216.html |