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