diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2021-06-07 12:55:55 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2021-07-09 19:05:20 +0200 |
commit | 4465033643741d8f3f73de6e2da6052a3044d3d7 (patch) | |
tree | 054a71a66e31082ef01f9497ca63c8bbef8a6eea | |
parent | 982f4ac1f173194321eaa2be5a39e65537318d18 (diff) | |
download | systemd-4465033643741d8f3f73de6e2da6052a3044d3d7.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.
(cherry picked from commit f75420a43a4dc3c69210f887b38f5df23660ea16)
-rw-r--r-- | man/systemd.unit.xml | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/man/systemd.unit.xml b/man/systemd.unit.xml index 8f8b5051b8..c5a2c441c7 100644 --- a/man/systemd.unit.xml +++ b/man/systemd.unit.xml @@ -1333,11 +1333,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> |