]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
units: make system-update-pre.target a passive unit (#9349)
authorLennart Poettering <lennart@poettering.net>
Wed, 20 Jun 2018 10:46:18 +0000 (12:46 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 20 Jun 2018 10:46:18 +0000 (12:46 +0200)
This is an additional synchronization point normally not needed. Hence,
let's make it passive, i.e. pull it in from the unit which wants to be
ordered before the update service rather than by the update service
itself.

NEWS
man/systemd.special.xml
units/system-update-pre.target
units/system-update.target

diff --git a/NEWS b/NEWS
index da2d9defca2a9902854d53a686a70a3691cfdf53..643ae5df0e2783b9bec53f9f8ea84f1623064d14 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -326,6 +326,12 @@ CHANGES WITH 239 in spe:
           system namespacing options. One such service is systemd-udevd.service
           wher this is now used by default.
 
+        * A new unit "system-update-pre.target" is added, which defines an
+          optional synchronization point for offline system updates, as
+          implemented by the pre-existing "system-update.target" unit. It
+          allows ordering services before the service that executes the actual
+          update process in a generic way.
+
         Contributions from: Adam Duskett, Alan Jenkins, Alessandro Casale,
         Alexander Kurtz, Alex Gartrell, Anssi Hannula, Arnaud Rebillout, Brian
         J. Murrell, Bruno Vernay, Chris Lesiak, Christian Brauner, Christian
index 2776276a1d73977c73103450a8fa142587e830e5..fb12805fff10d795d7609ea32e137f4d479172ae 100644 (file)
@@ -78,6 +78,7 @@
     <filename>swap.target</filename>,
     <filename>sysinit.target</filename>,
     <filename>system-update.target</filename>,
+    <filename>system-update-pre.target</filename>,
     <filename>time-sync.target</filename>,
     <filename>timers.target</filename>,
     <filename>umount.target</filename>,
       </varlistentry>
       <varlistentry>
         <term><filename>system-update.target</filename></term>
+        <term><filename>system-update-pre.target</filename></term>
         <term><filename>system-update-cleanup.service</filename></term>
         <listitem>
           <para>A special target unit that is used for offline system updates.
           <citerefentry><refentrytitle>systemd.offline-updates</refentrytitle><manvolnum>7</manvolnum></citerefentry>.
           </para>
 
-          <para>Updates should happen before the <filename>system-update.target</filename> is
-          reached, and the services which implement them should cause the machine to reboot. As
-          a safety measure, if this does not happen, and <filename>/system-update</filename>
-          still exists after <filename>system-update.target</filename> is reached,
-          <filename>system-update-cleanup.service</filename> will remove this symlink and
-          reboot the machine.</para>
+          <para>Updates should happen before the <filename>system-update.target</filename> is reached, and the services
+          which implement them should cause the machine to reboot. The main units executing the update should order
+          themselves after <filename>system-update-pre.target</filename> but not pull it in. Services which want to run
+          during system updates only, but before the actual system update is executed should order themselves before
+          this unit and pull it in. As a safety measure, if this does not happen, and
+          <filename>/system-update</filename> still exists after <filename>system-update.target</filename> is reached,
+          <filename>system-update-cleanup.service</filename> will remove this symlink and reboot the machine.</para>
         </listitem>
       </varlistentry>
       <varlistentry>
index dbd9ad92ec50ebbf2daaf1d73e2b739cd19f8263..163b75c220d273fdbd68966c9cfd615c64a8a8ff 100644 (file)
@@ -13,4 +13,3 @@ Documentation=man:systemd.offline-updates(7)
 Documentation=man:systemd.special(7) man:systemd-system-update-generator(8)
 RefuseManualStart=yes
 After=sysinit.target
-Before=system-update.target
index b52a494892a633ebab48082baf76bae794c5e0ab..be007e306d5c044881345f77109c43231fe91682 100644 (file)
@@ -12,7 +12,6 @@ Description=Offline System Update
 Documentation=man:systemd.offline-updates(7)
 Documentation=man:systemd.special(7) man:systemd-system-update-generator(8)
 Requires=sysinit.target
-After=sysinit.target
+After=sysinit.target system-update.target
 AllowIsolate=yes
-Wants=system-update-pre.target
 Wants=system-update-cleanup.service