mirror of
https://github.com/systemd/systemd.git
synced 2024-12-12 11:44:13 +08:00
a55654d598
This new condition allows checking whether /etc or /var are out-of-date relative to /usr. This is the counterpart for the update flag managed by systemd-update-done.service. Services that want to be started once after /usr got updated should use: [Unit] ConditionNeedsUpdate=/etc Before=systemd-update-done.service This makes sure that they are only run if /etc is out-of-date relative to /usr. And that it will be executed after systemd-update-done.service which is responsible for marking /etc up-to-date relative to the current /usr. ConditionNeedsUpdate= will also checks whether /etc is actually writable, and not trigger if it isn't, since no update is possible then.
24 lines
751 B
SYSTEMD
24 lines
751 B
SYSTEMD
# This file is part of systemd.
|
|
#
|
|
# systemd is free software; you can redistribute it and/or modify it
|
|
# under the terms of the GNU Lesser General Public License as published by
|
|
# the Free Software Foundation; either version 2.1 of the License, or
|
|
# (at your option) any later version.
|
|
|
|
[Unit]
|
|
Description=Update is Completed
|
|
Documentation=man:sysusers.d(5) man:systemd-sysusers(8)
|
|
DefaultDependencies=no
|
|
Conflicts=shutdown.target
|
|
After=systemd-readahead-collect.service systemd-readahead-replay.service local-fs.target
|
|
Before=sysinit.target shutdown.target
|
|
RefuseManualStart=yes
|
|
RefuseManualStop=yes
|
|
ConditionNeedsUpdate=|/etc
|
|
ConditionNeedsUpdate=|/var
|
|
|
|
[Service]
|
|
Type=oneshot
|
|
RemainAfterExit=yes
|
|
ExecStart=@rootlibexecdir@/systemd-update-done
|