From ab3461e792a3b9a525a895bb0b3a70e55955efb6 Mon Sep 17 00:00:00 2001 From: Adam Spragg Date: Sun, 13 Mar 2022 17:36:46 +0000 Subject: First (mostly) working version apt-desktop-upgrades --- adu-upgrade.service | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 adu-upgrade.service (limited to 'adu-upgrade.service') diff --git a/adu-upgrade.service b/adu-upgrade.service new file mode 100644 index 0000000..872ddf2 --- /dev/null +++ b/adu-upgrade.service @@ -0,0 +1,31 @@ +# man:systemd.offline-updates(7): +# "Use FailureAction=reboot in the service file for your update script to +# ensure that a reboot is automatically triggered if the update fails." +# [...] +# "The update service should declare DefaultDependencies=no, +# Requires=sysinit.target, After=sysinit.target, +# After=system-update-pre.target, Before=system-update.target and explicitly +# pull in any other services it requires." +[Unit] +Description=Apt Desktop Upgrades package upgrader +FailureAction=reboot +DefaultDependencies=no +Requires=sysinit.target +After=sysinit.target +After=system-update-pre.target +Before=system-update.target + +[Service] +Type=oneshot +ExecStart=/usr/local/sbin/adu-upgrade + +# man:systemd.offline-updates(7): +# "To make things a bit more robust we recommend hooking the update script +# into system-update.target via a .wants/ symlink in the distribution +# package, rather than depending on systemctl enable in the postinst +# scriptlets of your package. More specifically, for your update script +# create a .service file, without [Install] section, and then add a symlink +# like /lib/systemd/system/system-update.target.wants/foobar.service → ../foobar.service +# to your package." +#[Install] +#WantedBy=offline-updates.target -- cgit v1.2.1