diff options
author | Daan De Meyer <daan.j.demeyer@gmail.com> | 2024-10-10 22:37:39 +0200 |
---|---|---|
committer | Daan De Meyer <daan.j.demeyer@gmail.com> | 2024-10-11 10:36:08 +0200 |
commit | 2d0af8bc354f4a1429cebedfb387af72c88720a0 (patch) | |
tree | dc45370b7bb73732c8f042a66f2e83b1af00ada5 /src/rpm | |
parent | units/{user,capsule}@.service: issue daemon-reexec when notify-reloading (diff) | |
download | systemd-2d0af8bc354f4a1429cebedfb387af72c88720a0.tar.xz systemd-2d0af8bc354f4a1429cebedfb387af72c88720a0.zip |
rpm/systemd-update-helper: Use systemctl reload to reexec/reload user managers
Let's always use systemctl reload to reexec and reload user managers
now that it always implies a reexec. This moves all the job management
logic to pid 1 instead of bash and reduces the complexity of the logic
as we remove systemd-run, pam and systemd-stdio-bridge from the equation.
Diffstat (limited to 'src/rpm')
-rwxr-xr-x | src/rpm/systemd-update-helper.in | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/src/rpm/systemd-update-helper.in b/src/rpm/systemd-update-helper.in index c81e16c3d3..8af9149352 100755 --- a/src/rpm/systemd-update-helper.in +++ b/src/rpm/systemd-update-helper.in @@ -107,25 +107,13 @@ case "$command" in [ -d /run/systemd/system ] || exit 0 - 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_SEC}}s \ - 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_SEC}}s \ - systemctl --user -M "$user@" daemon-reload & - done - wait + if [[ "$command" =~ reexec|reload ]]; then + SYSTEMD_BUS_TIMEOUT={{UPDATE_HELPER_USER_TIMEOUT_SEC}}s systemctl reload "user@*.service" fi if [[ "$command" =~ restart ]]; then + users=$(systemctl list-units 'user@*' --legend=no | sed -n -r 's/.*user@([0-9]+).service.*/\1/p') + for user in $users; do SYSTEMD_BUS_TIMEOUT={{UPDATE_HELPER_USER_TIMEOUT_SEC}}s \ systemctl --user -M "$user@" reload-or-restart --marked & |