]> git.ipfire.org Git - thirdparty/systemd.git/blob - units/system-update-cleanup.service.in
Merge pull request #5131 from keszybz/environment-generators
[thirdparty/systemd.git] / units / system-update-cleanup.service.in
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]
9 Description=Remove the Offline System Updates symlink
10 Documentation=man:systemd.special(5) man:systemd.offline-updates(7)
11 After=system-update.target
12 DefaultDependencies=no
13 Conflicts=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.
26 ConditionPathExists=|/system-update
27 ConditionPathIsSymbolicLink=|/system-update
28
29 [Service]
30 Type=oneshot
31 ExecStart=/bin/rm -fv /system-update
32 ExecStart=@SYSTEMCTL@ reboot