]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - man/systemd.offline-updates.xml
build: skip installation of 2 files if feature is disabled
[thirdparty/systemd.git] / man / systemd.offline-updates.xml
index 01dd6c55e47d127a66284599b09cc62755661032..81a37f67898c649bc1d42da5fe6b0460167f28e8 100644 (file)
@@ -1,42 +1,12 @@
 <?xml version='1.0'?> <!--*-nxml-*-->
-<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
   "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
-
-<!--
-  SPDX-License-Identifier: LGPL-2.1+
-
-  This file is part of systemd.
-
-  Copyright 2013 Lennart Poettering
-  Copyright 2016 Zbigniew Jędrzejewski-Szmek
-
-  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.
-
-  systemd is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-  Lesser General Public License for more details.
-
-  You should have received a copy of the GNU Lesser General Public License
-  along with systemd; If not, see <http://www.gnu.org/licenses/>.
--->
+<!-- SPDX-License-Identifier: LGPL-2.1+ -->
 
 <refentry id="systemd.offline-updates">
   <refentryinfo>
     <title>systemd.offline-updates</title>
     <productname>systemd</productname>
-
-    <authorgroup>
-      <author>
-        <contrib>Developer</contrib>
-        <firstname>Lennart</firstname>
-        <surname>Poettering</surname>
-        <email>lennart@poettering.net</email>
-      </author>
-    </authorgroup>
   </refentryinfo>
 
   <refmeta>
 
     <orderedlist>
       <listitem>
-        <para>The package manager prepares system updates by downloading all (RPM or DEB or
+        <para>The package manager prepares system updates by downloading all (.rpm or .deb or
         whatever) packages to update off-line in a special directory
-        <filename noindex="true">/var/lib/system-update</filename> (or
+        <filename index="false">/var/lib/system-update</filename> (or
         another directory of the package/upgrade manager's choice).</para>
       </listitem>
 
       <listitem>
         <para>When the user OK'ed the update, the symlink <filename>/system-update</filename> is
-        created that points to <filename noindex="true">/var/lib/system-update</filename> (or
+        created that points to <filename index="false">/var/lib/system-update</filename> (or
         wherever the directory with the upgrade files is located) and the system is rebooted. This
         symlink is in the root directory, since we need to check for it very early at boot, at a
         time where <filename>/var</filename> is not available yet.</para>
@@ -82,7 +52,7 @@
         <citerefentry><refentrytitle>systemd-system-update-generator</refentrytitle><manvolnum>8</manvolnum></citerefentry>
         checks whether <filename>/system-update</filename> exists. If so, it (temporarily and for
         this boot only) redirects (i.e. symlinks) <filename>default.target</filename> to
-        <filename>system-update.target</filename>, a special target that is pulls in the base system
+        <filename>system-update.target</filename>, a special target that pulls in the base system
         (i.e. <filename>sysinit.target</filename>, so that all file systems are mounted but little
         else) and the system update units.</para>
       </listitem>
       </listitem>
 
       <listitem>
-        <para>The upgrade scripts should exit only after the update is finished. It is expected
-        that the service which performs the upgrade will cause the machine to reboot after it
+        <para>The update scripts should exit only after the update is finished. It is expected
+        that the service which performs the update will cause the machine to reboot after it
         is done. If the <filename>system-update.target</filename> is successfully reached, i.e.
         all update services have run, and the <filename>/system-update</filename> symlink still
         exists, it will be removed and the machine rebooted as a safety measure.</para>
     <orderedlist>
       <listitem>
         <para>To make things a bit more robust we recommend hooking the update script into
-        <filename>system-update.target</filename> via a <filename noindex='true'>.wants/</filename>
+        <filename>system-update.target</filename> via a <filename index="false">.wants/</filename>
         symlink in the distribution package, rather than depending on <command>systemctl
         enable</command> in the postinst scriptlets of your package. More specifically, for your
         update script create a .service file, without [Install] section, and then add a symlink like
-        <filename noindex='true'>/usr/lib/systemd/system-update.target.wants/foobar.service</filename>
-        → <filename noindex='true'>../foobar.service</filename> to your package.</para>
+        <filename index="false">/usr/lib/systemd/system-update.target.wants/foobar.service</filename>
+        → <filename index="false">../foobar.service</filename> to your package.</para>
       </listitem>
 
       <listitem>
       </listitem>
 
       <listitem>
-        <para>The update service should declare <varname>DefaultDependencies=false</varname>,
+        <para>The update service should declare <varname>DefaultDependencies=no</varname>,
         <varname>Requires=sysinit.target</varname>, <varname>After=sysinit.target</varname>,
+        <varname>After=system-update-pre.target</varname>, <varname>Before=system-update.target</varname>
         and explicitly pull in any other services it requires.</para>
       </listitem>
+
+      <listitem>
+        <para>It may be desirable to always run an auxiliary unit when booting
+        into offline-updates mode, which itself does not install updates. To
+        do this create a .service file with
+        <varname>Wants=system-update-pre.target</varname> and
+        <varname>Before=system-update-pre.target</varname> and add a symlink
+        to that file under
+        <filename index="false">/usr/lib/systemd/system-update.target.wants</filename>
+        .</para>
+      </listitem>
     </orderedlist>
   </refsect1>