aboutsummaryrefslogtreecommitdiff
path: root/adu-upgrade.service
blob: 872ddf2144fdc03c8d3b5e94a2a606dbdf24b0cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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