aboutsummaryrefslogtreecommitdiff
path: root/adu-upgrade.service
diff options
context:
space:
mode:
authorAdam Spragg <adam@spra.gg>2022-03-13 17:36:46 +0000
committerAdam Spragg <adam@spra.gg>2022-03-13 17:36:46 +0000
commitab3461e792a3b9a525a895bb0b3a70e55955efb6 (patch)
treed8abe25eab49ade25880946a40451f42249e5e97 /adu-upgrade.service
First (mostly) working version apt-desktop-upgrades
Diffstat (limited to 'adu-upgrade.service')
-rw-r--r--adu-upgrade.service31
1 files changed, 31 insertions, 0 deletions
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