]> git.ipfire.org Git - thirdparty/systemd.git/blame - units/system-update-cleanup.service.in
units: add system-update-cleanup.service to guard against offline-update loops
[thirdparty/systemd.git] / units / system-update-cleanup.service.in
CommitLineData
953bf460
ZJS
1# This file is part of systemd.
2#
3# systemd is free software; you can redistribute it and/or modify it
4# under the terms of the GNU Lesser General Public License as published by
5# the Free Software Foundation; either version 2.1 of the License, or
6# (at your option) any later version.
7
8[Unit]
9Description=Remove the Offline System Updates symlink
10Documentation=man:systemd.special(5) man:systemd.offline-updates(7)
11After=system-update.target
12DefaultDependencies=no
13Conflicts=shutdown.target
14
15# system-update-generator uses laccess("/system-update"), while a plain
16# ConditionPathExists=/system-update uses access("/system-update"), so
17# we need an alternate condition to cover the case of a dangling symlink.
18#
19# This service is only invoked if /system-update exists, i.e. if the
20# condition tested by system-update-generator remains true and the system
21# would be diverted into system-update.target again after reboot. This way
22# we guard against being diverted into system-update.target again, which
23# works as a safety measure, but we will not step on the toes of the
24# update script if it successfully removed the symlink and scheduled a
25# reboot or some other action on its own.
26ConditionPathExists=|/system-update
27ConditionPathIsSymbolicLink=|/system-update
28
29[Service]
30Type=oneshot
31ExecStart=/bin/rm -fv /system-update
32ExecStart=@SYSTEMCTL@ reboot