From db3bfa0c4cd7f5246ca73d399c8f9e2e337bd313 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Mon, 20 Apr 2026 18:02:42 +0100 Subject: [PATCH] sysupdate: Emit READY=1 status when installing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `READY=1` is already correctly emitted when acquiring an update, but was forgotten to be emitted when subsequently installing that update. That meant that the state tracking code in `sysupdated` and hence `updatectl` could not properly report the progress of the install operation, and hence printed “Already up-to-date” after a successful update installation, rather than “Done”. Add a test to catch this in future. Signed-off-by: Philip Withnall Fixes: https://github.com/systemd/systemd/issues/41502 --- src/sysupdate/sysupdate.c | 4 +++- test/units/TEST-72-SYSUPDATE.sh | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/sysupdate/sysupdate.c b/src/sysupdate/sysupdate.c index 9c469fbe856..76b6507f9a4 100644 --- a/src/sysupdate/sysupdate.c +++ b/src/sysupdate/sysupdate.c @@ -1202,7 +1202,9 @@ static int context_install( } (void) sd_notifyf(/* unset_environment=*/ false, - "STATUS=Installing '%s'.", us->version); + "READY=1\n" + "X_SYSUPDATE_VERSION=%s\n" + "STATUS=Installing '%s'.", us->version, us->version); for (size_t i = 0; i < c->n_transfers; i++) { Instance *inst = us->instances[i]; diff --git a/test/units/TEST-72-SYSUPDATE.sh b/test/units/TEST-72-SYSUPDATE.sh index b929485bd5b..27268c250b5 100755 --- a/test/units/TEST-72-SYSUPDATE.sh +++ b/test/units/TEST-72-SYSUPDATE.sh @@ -373,7 +373,9 @@ EOF if $have_updatectl; then systemctl start systemd-sysupdated "$SYSUPDATE" --verify=no check-new - updatectl update + updatectl update |& tee "$WORKDIR"/updatectl-update-6 + grep "Done" "$WORKDIR"/updatectl-update-6 + (! grep "Already up-to-date" "$WORKDIR"/updatectl-update-6) else # If no updatectl, gracefully fall back to systemd-sysupdate update_now "$update_type"