sys-apps/systemd: sysupdate do not fail#4118
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a Gentoo user-patch for sys-apps/systemd to prevent systemd-sysupdate invocations (e.g., via timers/services) from exiting non-zero when no transfer definitions are present, addressing Flatcar issue #1979 where the resulting failed units are considered harmless noise.
Changes:
- Introduce a systemd patch intended to downgrade “no transfer definitions” from an error to a warning while returning success.
- Adjust
src/sysupdate/sysupdate.cbehavior (via patch) for the “no transfers defined” condition.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| From f5f1ae2462f192825c5cfd050b33d093a68d8add Mon Sep 17 00:00:00 2001 | ||
| From: Mathieu Tortuyaux <mtortuyaux@microsoft.com> | ||
| Date: Tue, 23 Jun 2026 14:44:49 +0200 | ||
| Subject: [PATCH] sysupdate: do not fail when no transfers are defined |
| We can still warn but this should not fail (i.e return an exit code | ||
| different from zero). |
| Subject: [PATCH] sysupdate: do not fail when no transfers are defined | ||
|
|
||
| `sysupdate` operations like 'list', 'reboot', etc. should not fail when | ||
| no transfers are defined. | ||
|
|
||
| We can still warn but this should not fail (i.e return an exit code | ||
| different from zero). | ||
|
|
||
| Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com> |
fab43c4 to
142ed2c
Compare
| + if (!context->newest_installed || context->n_transfers) { | ||
| + log_warning("Couldn't find any suitable installed versions."); | ||
| + return 0; | ||
| + } |
There was a problem hiding this comment.
I'm not sufficiently familiar with this to say for sure whether Copilot is right here, but I think it might be, even though its other points weren't that helpful.
There was a problem hiding this comment.
Same here - what I like with the copilot approach is that it really preserves the initial behavior so we should not introduce side effects.
EDIT: Applied the proposal + kicked-off a CI
There was a problem hiding this comment.
@chewi that seems to do the trick. It sill works as expected and I think it might get higher chance to get approved upstream. I'll now proceed to upstream PR if it works for you.
| + if (arg_component) { | ||
| + log_warning("No transfer definitions for component '%s' found.", arg_component); | ||
| + return 0; | ||
| + } |
| We can still warn but this should not fail (i.e return an exit code | ||
| different from zero). |
ac11b05 to
85c642d
Compare
| From 948a3c664050d9f74b98e2b016cb810aaf4e9651 Mon Sep 17 00:00:00 2001 | ||
| From: Mathieu Tortuyaux <mtortuyaux@microsoft.com> | ||
| Date: Tue, 23 Jun 2026 14:44:49 +0200 | ||
| Subject: [PATCH] sysupdate: do not fail when no transfers are defined |
Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
3395e94 to
cdcb555
Compare
Attempt to solve: flatcar/Flatcar#1979 with an upstream approach.
TODO:
CI ✔️ : https://jenkins.flatcar.org/job/container/job/packages_all_arches/279/cldsv/