diff options
-rwxr-xr-x | bin/pacman-offline | 11 | ||||
-rw-r--r-- | hook/99-pacman-offline.hook | 2 | ||||
-rwxr-xr-x | systemd/pacman-offline | 3 |
3 files changed, 13 insertions, 3 deletions
diff --git a/bin/pacman-offline b/bin/pacman-offline index edb608f..a6e2a99 100755 --- a/bin/pacman-offline +++ b/bin/pacman-offline @@ -112,9 +112,18 @@ fi if [ ${REBOOT} -eq 1 ]; then echo "Soft-rebooting for update." systemctl soft-reboot -# force a soft-reboot on (manual) reboot else + # force a soft-reboot on (manual) reboot ... ln -sf ../../../usr/lib/systemd/system/systemd-soft-reboot.service /run/systemd/system/systemd-reboot.service + + # ... and also on poweroff, but prepare poweroff + cp /usr/lib/systemd/system/systemd-soft-reboot.service /run/systemd/system/systemd-poweroff.service + cat >> /run/systemd/system/systemd-poweroff.service <<-EOF + + [Service] + ExecStart=/usr/bin/touch /run/system-update-poweroff + EOF + systemctl daemon-reload fi diff --git a/hook/99-pacman-offline.hook b/hook/99-pacman-offline.hook index 19dc366..9c4f456 100644 --- a/hook/99-pacman-offline.hook +++ b/hook/99-pacman-offline.hook @@ -8,4 +8,4 @@ Target = * [Action] Description = Disabling scheduled pacman offline update... When = PostTransaction -Exec = /bin/sh -c 'rm --force /system-update /run/systemd/system/systemd-reboot.service && systemctl daemon-reload' +Exec = /bin/sh -c 'rm --force /system-update /run/systemd/system/systemd-poweroff.service /run/systemd/system/systemd-reboot.service && systemctl daemon-reload' diff --git a/systemd/pacman-offline b/systemd/pacman-offline index 83d2791..ca14ba2 100755 --- a/systemd/pacman-offline +++ b/systemd/pacman-offline @@ -19,8 +19,9 @@ function finish { rm -f /run/pacman.conf; } trap finish EXIT sed '/^Include *= *\/etc\/pacman\.d\/offline\.conf$/s|^|#|' < /etc/pacman.conf > /run/pacman.conf -# remove triggering symlink and (soft-)reboot override +# remove triggering symlink and reboot & poweroff override rm -f /system-update +rm -f /run/systemd/system/systemd-poweroff.service rm -f /run/systemd/system/systemd-reboot.service # install updates |