summaryrefslogtreecommitdiff
path: root/man/systemd.unit.xml
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-06-07 12:55:55 +0200
committerLennart Poettering <lennart@poettering.net>2021-06-08 10:47:11 +0200
commitf75420a43a4dc3c69210f887b38f5df23660ea16 (patch)
treed5cc8a9e545981341db0499035acd6d5cbc07e6f /man/systemd.unit.xml
parent16e09d51a7f5f688d5b699806f6f092f590d2e0d (diff)
downloadsystemd-f75420a43a4dc3c69210f887b38f5df23660ea16.tar.gz
man: explain ConditionNeedsUpdate a bit more
We were effectively doing all post-upgrade scripts twice in Fedora. We got this wrong, so it's likely other people will get it wrong too. So let's explain what is actually needed to make this work, but also when it's not useful.
Diffstat (limited to 'man/systemd.unit.xml')
-rw-r--r--man/systemd.unit.xml16
1 files changed, 14 insertions, 2 deletions
diff --git a/man/systemd.unit.xml b/man/systemd.unit.xml
index 03e42d5fd8..12e3610ab8 100644
--- a/man/systemd.unit.xml
+++ b/man/systemd.unit.xml
@@ -1374,11 +1374,23 @@
<para>If the <varname>systemd.condition-needs-update=</varname> option is specified on the kernel
command line (taking a boolean), it will override the result of this condition check, taking
- precedence over any file modification time checks. If it is used
+ precedence over any file modification time checks. If the kernel command line option is used,
<filename>systemd-update-done.service</filename> will not have immediate effect on any following
<varname>ConditionNeedsUpdate=</varname> checks, until the system is rebooted where the kernel
command line option is not specified anymore.</para>
- </listitem>
+
+ <para>Note that to make this scheme effective, the timestamp of <filename>/usr/</filename> should
+ be explicitly updated after its contents are modified. The kernel will automatically update
+ modification timestamp on a directory only when immediate children of a directory are modified; an
+ modification of nested files will not automatically result in mtime of <filename>/usr/</filename>
+ being updated.</para>
+
+ <para>Also note that if the update method includes a call to execute appropriate post-update steps
+ itself, it should not touch the timestamp of <filename>/usr/</filename>. In a typical distribution
+ packaging scheme, packages will do any required update steps as part of the installation or
+ upgrade, to make package contents immediately usable. <varname>ConditionNeedsUpdate=</varname>
+ should be used with other update mechanisms where such an immediate update does not
+ happen.</para></listitem>
</varlistentry>
<varlistentry>