[Bug 1849261] Re: Update systemd for ubuntu 18.04 with fix for interaction between OnFailure= and Restart=
Steve Langasek
steve.langasek at canonical.com
Mon Feb 3 21:55:08 UTC 2020
Hello bugproxy, or anyone else affected,
Accepted systemd into bionic-proposed. The package will build now and be
available at
https://launchpad.net/ubuntu/+source/systemd/237-3ubuntu10.34 in a few
hours, and then in the -proposed repository.
Please help us by testing this new package. See
https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how
to enable and use -proposed. Your feedback will aid us getting this
update out to other Ubuntu users.
If this package fixes the bug for you, please add a comment to this bug,
mentioning the version of the package you tested and change the tag from
verification-needed-bionic to verification-done-bionic. If it does not
fix the bug for you, please add a comment stating that, and change the
tag to verification-failed-bionic. In either case, without details of
your testing we will not be able to proceed.
Further information regarding the verification process can be found at
https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in
advance for helping!
N.B. The updated package will be released to -updates after the bug(s)
fixed by this package have been verified and the package has been in
-proposed for a minimum of 7 days.
** Changed in: systemd (Ubuntu Bionic)
Status: In Progress => Fix Committed
** Tags added: verification-needed verification-needed-bionic
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to systemd in Ubuntu.
https://bugs.launchpad.net/bugs/1849261
Title:
Update systemd for ubuntu 18.04 with fix for interaction between
OnFailure= and Restart=
Status in Ubuntu on IBM z Systems:
In Progress
Status in systemd package in Ubuntu:
Fix Released
Status in systemd source package in Xenial:
Won't Fix
Status in systemd source package in Bionic:
Fix Committed
Status in systemd source package in Disco:
Fix Released
Status in systemd source package in Eoan:
Fix Released
Bug description:
[impact]
services configured with both OnFailure= and Restart= directives will
both start the failure service(s), as well as restarting itself. The
documentation (and later versions) indicate that OnFailure= services
will only be started once the service actually does stop (due to
failure) once its restart limit has been exceeded.
[test case]
create service files as:
ubuntu at lp1849261-b:/etc/systemd/system$ cat test.service
[Unit]
OnFailure=failure.service
[Service]
ExecStart=/bin/sh -c '/bin/sleep 10; /bin/false'
Restart=always
ubuntu at lp1849261-b:/etc/systemd/system$ cat failure.service
[Service]
ExecStart=/bin/true
perform daemon-reload, and then start test service:
ubuntu at lp1849261-b:/etc/systemd/system$ sudo systemctl daemon-reload
ubuntu at lp1849261-b:/etc/systemd/system$ sudo systemctl start test
wait for a while for the test service to exit - at least 10 seconds,
as that's what we configured in the service, although I have waited
longer in this example. Then check the journal for both test and
failure services:
ubuntu at lp1849261-b:/etc/systemd/system$ journalctl -b -u test
-- Logs begin at Fri 2019-12-13 00:52:50 UTC, end at Fri 2019-12-13 01:18:34 UTC. --
Dec 13 01:17:43 lp1849261-b systemd[1]: Started test.service.
Dec 13 01:17:53 lp1849261-b systemd[1]: test.service: Main process exited, code=exited, status=1/FAILURE
Dec 13 01:17:53 lp1849261-b systemd[1]: test.service: Failed with result 'exit-code'.
Dec 13 01:17:53 lp1849261-b systemd[1]: test.service: Triggering OnFailure= dependencies.
Dec 13 01:17:53 lp1849261-b systemd[1]: test.service: Service hold-off time over, scheduling restart.
Dec 13 01:17:53 lp1849261-b systemd[1]: test.service: Scheduled restart job, restart counter is at 1.
Dec 13 01:17:53 lp1849261-b systemd[1]: Stopped test.service.
Dec 13 01:17:53 lp1849261-b systemd[1]: Started test.service.
Dec 13 01:18:03 lp1849261-b systemd[1]: test.service: Main process exited, code=exited, status=1/FAILURE
Dec 13 01:18:03 lp1849261-b systemd[1]: test.service: Failed with result 'exit-code'.
Dec 13 01:18:03 lp1849261-b systemd[1]: test.service: Triggering OnFailure= dependencies.
Dec 13 01:18:04 lp1849261-b systemd[1]: test.service: Service hold-off time over, scheduling restart.
Dec 13 01:18:04 lp1849261-b systemd[1]: test.service: Scheduled restart job, restart counter is at 2.
Dec 13 01:18:04 lp1849261-b systemd[1]: Stopped test.service.
Dec 13 01:18:04 lp1849261-b systemd[1]: Started test.service.
Dec 13 01:18:14 lp1849261-b systemd[1]: test.service: Main process exited, code=exited, status=1/FAILURE
Dec 13 01:18:14 lp1849261-b systemd[1]: test.service: Failed with result 'exit-code'.
Dec 13 01:18:14 lp1849261-b systemd[1]: test.service: Triggering OnFailure= dependencies.
Dec 13 01:18:14 lp1849261-b systemd[1]: test.service: Service hold-off time over, scheduling restart.
Dec 13 01:18:14 lp1849261-b systemd[1]: test.service: Scheduled restart job, restart counter is at 3.
Dec 13 01:18:14 lp1849261-b systemd[1]: Stopped test.service.
Dec 13 01:18:14 lp1849261-b systemd[1]: Started test.service.
Dec 13 01:18:24 lp1849261-b systemd[1]: test.service: Main process exited, code=exited, status=1/FAILURE
Dec 13 01:18:24 lp1849261-b systemd[1]: test.service: Failed with result 'exit-code'.
Dec 13 01:18:24 lp1849261-b systemd[1]: test.service: Triggering OnFailure= dependencies.
Dec 13 01:18:24 lp1849261-b systemd[1]: test.service: Service hold-off time over, scheduling restart.
Dec 13 01:18:24 lp1849261-b systemd[1]: test.service: Scheduled restart job, restart counter is at 4.
Dec 13 01:18:24 lp1849261-b systemd[1]: Stopped test.service.
Dec 13 01:18:24 lp1849261-b systemd[1]: Started test.service.
Dec 13 01:18:34 lp1849261-b systemd[1]: test.service: Main process exited, code=exited, status=1/FAILURE
Dec 13 01:18:34 lp1849261-b systemd[1]: test.service: Failed with result 'exit-code'.
Dec 13 01:18:34 lp1849261-b systemd[1]: test.service: Triggering OnFailure= dependencies.
Dec 13 01:18:34 lp1849261-b systemd[1]: test.service: Service hold-off time over, scheduling restart.
Dec 13 01:18:34 lp1849261-b systemd[1]: test.service: Scheduled restart job, restart counter is at 5.
Dec 13 01:18:34 lp1849261-b systemd[1]: Stopped test.service.
Dec 13 01:18:34 lp1849261-b systemd[1]: Started test.service.
ubuntu at lp1849261-b:/etc/systemd/system$ journalctl -b -u failure
-- Logs begin at Fri 2019-12-13 00:52:50 UTC, end at Fri 2019-12-13 01:19:15 UTC. --
Dec 13 01:17:53 lp1849261-b systemd[1]: Started failure.service.
Dec 13 01:18:03 lp1849261-b systemd[1]: Started failure.service.
Dec 13 01:18:14 lp1849261-b systemd[1]: Started failure.service.
Dec 13 01:18:24 lp1849261-b systemd[1]: Started failure.service.
Dec 13 01:18:34 lp1849261-b systemd[1]: Started failure.service.
Dec 13 01:18:44 lp1849261-b systemd[1]: Started failure.service.
Dec 13 01:18:55 lp1849261-b systemd[1]: Started failure.service.
Dec 13 01:19:05 lp1849261-b systemd[1]: Started failure.service.
Dec 13 01:19:15 lp1849261-b systemd[1]: Started failure.service.
note that the 'failure' service should not have been started at all.
[regression potential]
this changes how service failures are handled, specifically when
OnFailure= services are started. However, this changes the behavior
to be in line with the documentation, and the current behavior is
unlikely to be anyone's desired behavior - both starting the failure
service *and* restarting the failed service. However, this will cause
a regression for anyone *expecting* both the OnFailure= service(s) to
be started, as well as the failing service to be restarted.
Any other regression would likely occur during the state change of a
unit, most likely during stop/exit of a service.
[scope]
This is needed only for Bionic and Xenial (but marking WontFix for
Xenial).
The patches to fix this:
7f66b026bbdda6bd3ddf7f617bf2c3a475e4a665
2ad2e41a72ec19159c0746a78e15ff880fe32a63
are included already in Disco and later.
For Xenial, I'm marking this as WontFix because it has additional
backporting requirements; at least commit deb4e7080db and possibly
more. Without anyone specifically requesting this for Xenial, I think
the possibility for regression in Xenial due to the larger backport is
too high to proactively apply it.
[other info]
original description:
---
Within Ubunutu 18.04 systemd 237-3ubuntu10.31: amd64 arm64 armhf i386
ppc64el s390x is available,
The pull request for 240 is now requested to backport to 237 for
Ubuntu 18.04, which is integrated within the IBM product.
Pull request: https://github.com/systemd/systemd/pull/9158
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu-z-systems/+bug/1849261/+subscriptions
More information about the foundations-bugs
mailing list