Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1172841
Summary: | Service start returns success even when service fails to start | ||
---|---|---|---|
Product: | [Fedora] Fedora EPEL | Reporter: | Bill Nottingham <notting> |
Component: | redis | Assignee: | Nathan Scott <nathans> |
Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | epel7 | CC: | carl, fpercoco, hguemar, i, nathans, rcollet |
Target Milestone: | --- | Keywords: | Reopened |
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | redis-3.2.11-1.fc27 redis-3.2.11-1.fc26 redis-4.0.2-2.fc25 redis-3.2.12-1.el7 | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2017-11-28 04:11:01 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: |
Description
Bill Nottingham
2014-12-10 21:31:30 UTC
Thanks for the report, Bill. Assigning to @hguemar ack. I've looked into this one, understand the root cause now and have a fix. The underlying problem is that systemd starts the service successfully (this is a Type=Simple service - the default - not Type=forking, or another service type). So, systemd starts the process and as far as *it* can tell, it does so successfully even though the process fails very soon after starting (its not an immediate failure from systemd's POV). This phenomena is described here: https://serverfault.com/questions/751030/systemd-ignores-return-code-while-starting-service There is also a possible solution recommended there - to use Type=forking and a script (or helper program) that can verify more carefully that the daemon started and ensure the return code is more meaningful. Not described there however, is another solution which I think suits better here, and that is the use of a Type=notify service, since current Redis supports this natively. This is enabled by changing service type to "notify" in the service file, and changing the line "supervised no" to "supervised systemd" in the Redis configuration file). Here's how Bill's failure scenario (unavailable redis.conf) pans out now ... # mv /etc/redis.conf /etc/redis.conf.saved # systemctl start redis Job for redis.service failed because the control process exited with error code. See "systemctl status redis.service" and "journalctl -xe" for details. # echo $? 1 # mv /etc/redis.conf.saved /etc/redis.conf # systemctl start redis # echo $? 0 # I'll continue testing, but assuming all goes well I'll include this change in the next Redis build. > This is enabled by changing service type to "notify" in the service file,
> and changing the line "supervised no" to "supervised systemd" in the Redis configuration file).
Please don't rely on configuration file (this will be broken on update, config files are not updated)
Instead, use option in unit file
Type=Notify
ExecStart=/usr/bin/redis-server /etc/redis.conf --daemonize no --supervised systemd
From a quick test, seems to work as expected.
Ah yes - thanks Remi - I'll make that change before I push it. cheers. Addition notice: supervised implies daemonize=no, so perhaps this option could be dropped in src/server.c (checked in 4.0.1) int background = server.daemonize && !server.supervised; if (background) darmonize(); Same code is there in the 3.x series - thanks Remi, I'll make this change as well. redis-3.2.11-1.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2017-6d0c7eb24e redis-3.2.11-1.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-a2c6d143e8 redis-3.2.11-1.el7 has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2017-2735f42785 redis-3.2.11-1.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-165ee8a3f6 redis-3.2.11-1.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-6d0c7eb24e redis-3.2.11-1.el7 has been pushed to the Fedora EPEL 7 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2017-2735f42785 redis-3.2.11-1.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-165ee8a3f6 redis-3.2.11-1.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-a2c6d143e8 redis-3.2.11-1.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report. redis-3.2.11-1.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report. redis-4.0.2-2.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-343c274808 redis-4.0.2-2.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-343c274808 redis-4.0.2-2.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report. redis-3.2.12-1.el7 has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2018-8de40d24ca redis-3.2.12-1.el7 has been pushed to the Fedora EPEL 7 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2018-8de40d24ca redis-3.2.12-1.el7 has been pushed to the Fedora EPEL 7 stable repository. If problems still persist, please make note of it in this bug report. |