]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sysupdate: Emit READY=1 status when installing main
authorPhilip Withnall <pwithnall@gnome.org>
Mon, 20 Apr 2026 17:02:42 +0000 (18:02 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Mon, 20 Apr 2026 21:22:43 +0000 (22:22 +0100)
`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 <pwithnall@gnome.org>
Fixes: https://github.com/systemd/systemd/issues/41502
src/sysupdate/sysupdate.c
test/units/TEST-72-SYSUPDATE.sh

index 9c469fbe856c4a290828623850a9a4635c9f1726..76b6507f9a438e2667bcb501a87cfab5ad611091 100644 (file)
@@ -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];
index b929485bd5b6c1009b98500138694ea6e2ef8f21..27268c250b5e6c8a613e925a77246543e2d23b59 100755 (executable)
@@ -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"