Update systemd for ubuntu 18.04 with fix for interaction between OnFailure= and Restart=
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ubuntu on IBM z Systems |
Fix Released
|
High
|
Canonical Foundations Team | ||
systemd (Ubuntu) |
Fix Released
|
Undecided
|
Skipper Bug Screeners | ||
Xenial |
Won't Fix
|
Medium
|
Unassigned | ||
Bionic |
Fix Released
|
Medium
|
Dan Streetman | ||
Disco |
Fix Released
|
Undecided
|
Unassigned | ||
Eoan |
Fix Released
|
Undecided
|
Unassigned |
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@
[Unit]
OnFailure=
[Service]
ExecStart=/bin/sh -c '/bin/sleep 10; /bin/false'
Restart=always
ubuntu@
[Service]
ExecStart=/bin/true
perform daemon-reload, and then start test service:
ubuntu@
ubuntu@
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@
-- 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@
-- 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:
7f66b026bbdda6b
2ad2e41a72ec191
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:/
tags: | added: architecture-s39064 bugnameltc-182011 severity-high targetmilestone-inin1804 |
Changed in ubuntu: | |
assignee: | nobody → Skipper Bug Screeners (skipper-screen-team) |
affects: | ubuntu → systemd (Ubuntu) |
Changed in ubuntu-z-systems: | |
importance: | Undecided → High |
assignee: | nobody → Canonical Foundations Team (canonical-foundations) |
Changed in systemd (Ubuntu): | |
status: | New → Fix Released |
Changed in systemd (Ubuntu Eoan): | |
status: | New → Fix Released |
Changed in systemd (Ubuntu Disco): | |
status: | New → Fix Released |
summary: |
- Update systemd for ubuntu 18.04 with requested fix. + Update systemd for ubuntu 18.04 with fix for interaction between + OnFailure= and Restart= |
description: | updated |
Changed in ubuntu-z-systems: | |
status: | New → Triaged |
Changed in systemd (Ubuntu Bionic): | |
status: | New → In Progress |
assignee: | nobody → Dan Streetman (ddstreet) |
importance: | Undecided → Medium |
tags: | added: bionic ddstreet systemd |
Changed in ubuntu-z-systems: | |
status: | Triaged → In Progress |
description: | updated |
Changed in systemd (Ubuntu Xenial): | |
status: | New → In Progress |
assignee: | nobody → Dan Streetman (ddstreet) |
importance: | Undecided → Medium |
tags: | added: xenial |
description: | updated |
tags: | removed: xenial |
Changed in systemd (Ubuntu Xenial): | |
status: | In Progress → Won't Fix |
assignee: | Dan Streetman (ddstreet) → nobody |
tags: | added: id-5de127a738dabd05006e38e8 |
Changed in systemd (Ubuntu Bionic): | |
status: | In Progress → Triaged |
Changed in ubuntu-z-systems: | |
status: | In Progress → Triaged |
Changed in systemd (Ubuntu Bionic): | |
status: | Triaged → In Progress |
Changed in ubuntu-z-systems: | |
status: | Triaged → In Progress |
Changed in ubuntu-z-systems: | |
status: | In Progress → Fix Committed |
Changed in ubuntu-z-systems: | |
status: | Fix Committed → Fix Released |
We will not be upgrading systemd to a new upstream release in 18.04.
W.r.t. /github. com/systemd/ systemd/ pull/9158 /github. com/systemd/ systemd/ issues/ 8398
https:/
https:/
I thought we tried to backport that before, let me ping a few people if that was the case or not.