]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
update-helper: also add "user-reexec" verb 20276/head
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 23 Jul 2021 13:35:23 +0000 (15:35 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 24 Jul 2021 11:11:13 +0000 (13:11 +0200)
This is not called from the systemd.triggers or systemd.macros files. Instead,
it would be called from the scriptlets in systemd rpm package itself, at the
place where we call systemctl daemon-reexec.

See https://github.com/systemd/systemd/pull/20289#issuecomment-885622200 .

src/rpm/systemd-update-helper.in

index f3466ab3c05c577e706854ea279b3324ccccdf07..0c6675a9db04bc9c906589018eeeff7a1fb8254f 100755 (executable)
@@ -74,7 +74,7 @@ case "$command" in
         fi
         ;;
 
-    user-reload-restart|user-reload|user-restart)
+    user-reload-restart|user-reload|user-restart|user-reexec)
         if [ -n "$*" ]; then
             echo "Unexpected arguments for '$command': $*"
             exit 2
@@ -84,6 +84,14 @@ case "$command" in
 
         users=$(systemctl list-units 'user@*' --legend=no | sed -n -r 's/.*user@([0-9]+).service.*/\1/p')
 
+        if [[ "$command" =~ reexec ]]; then
+            for user in $users; do
+                SYSTEMD_BUS_TIMEOUT={{UPDATE_HELPER_USER_TIMEOUT}} \
+                        systemctl --user -M "$user@" daemon-reexec &
+            done
+            wait
+        fi
+
         if [[ "$command" =~ reload ]]; then
             for user in $users; do
                 SYSTEMD_BUS_TIMEOUT={{UPDATE_HELPER_USER_TIMEOUT}} \