]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
units: replace remote-cryptsetup-pre.target with remote-fs-pre.target
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 12 Oct 2017 20:34:54 +0000 (22:34 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 17 Oct 2017 17:15:58 +0000 (19:15 +0200)
remote-cryptsetup-pre.target was designed as an active unit (that pulls in
network-online.target), the opposite of remote-fs-pre.target (a passive unit,
with individual provider services ordering itself before it and pulling it in,
for example iscsi.service and nfs-client.target).

To make remote-cryptsetup-pre.target really work, those services should be
ordered before it too. But this would require updates to all those services,
not just changes from systemd side.

But the requirements for remote-fs-pre.target and remote-cryptset-pre.target
are fairly similar (e.g. iscsi devices can certainly be used for both), so
let's reuse remote-fs-pre.target also for remote cryptsetup units. This loses
a bit of flexibility, but does away with the requirement for various provider
services to know about remote-cryptsetup-pre.target.

man/crypttab.xml
man/systemd.special.xml
src/cryptsetup/cryptsetup-generator.c
units/meson.build
units/remote-cryptsetup-pre.target [deleted file]
units/remote-cryptsetup.target

index ac7d55271cadb86e44bdf2664fbe426ab7a2e4b4..caed04836e32df3a21491a612ffa012d7df4c38d 100644 (file)
         started after the network is available, similarly to
         <citerefentry><refentrytitle>systemd.mount</refentrytitle><manvolnum>5</manvolnum></citerefentry>
         units marked with <option>_netdev</option>. The service unit to set up this device
-        will be ordered between <filename>remote-cryptsetup-pre.target</filename> and
+        will be ordered between <filename>remote-fs-pre.target</filename> and
         <filename>remote-cryptsetup.target</filename>, instead of
         <filename>cryptsetup-pre.target</filename> and
         <filename>cryptsetup.target</filename>.</para></listitem>
index 69c24c3979feb1f1d5d97b2e5124b4e33073d8dd..bb0c79637738f968ffedb395015cbfecc2b703c6 100644 (file)
@@ -81,7 +81,6 @@
     <filename>poweroff.target</filename>,
     <filename>printer.target</filename>,
     <filename>reboot.target</filename>,
-    <filename>remote-cryptsetup-pre.target</filename>,
     <filename>remote-cryptsetup.target</filename>,
     <filename>remote-fs-pre.target</filename>,
     <filename>remote-fs.target</filename>,
           this target unit, for compatibility with SysV.</para>
         </listitem>
       </varlistentry>
-      <varlistentry>
-        <term><filename>remote-cryptsetup-pre.target</filename></term>
-        <listitem>
-          <para>This target unit is automatically ordered before all cryptsetup devices
-          marked with the <option>_netdev</option>. It can be used to execute additional
-          units before such devices are set up.</para>
-
-          <para>It is ordered after <filename>network.target</filename> and
-          <filename>network-online.target</filename>, and also pulls the latter in as a
-          <varname>Wants=</varname> dependency.</para>
-        </listitem>
-      </varlistentry>
       <varlistentry>
         <term><filename>remote-cryptsetup.target</filename></term>
         <listitem>
         <term><filename>remote-fs-pre.target</filename></term>
         <listitem>
           <para>This target unit is automatically ordered before all
-          remote mount point units (see above). It can be used to run
-          certain units before the remote mounts are established. Note
-          that this unit is generally not part of the initial
+          mount point units (see above) and cryptsetup devices
+          marked with the <option>_netdev</option>. It can be used to run
+          certain units before remote encrypted devices and mounts are established.
+          Note that this unit is generally not part of the initial
           transaction, unless the unit that wants to be ordered before
           all remote mounts pulls it in via a
           <varname>Wants=</varname> type dependency. If the unit wants
index 3752ca2ef2e1fc720383aec1194d9696ecea4fae..040a1aa4084b4dbdeff1a0adf4860e3ab210ce36 100644 (file)
@@ -113,7 +113,7 @@ static int create_disk(
                 "Conflicts=umount.target\n"
                 "IgnoreOnIsolate=true\n"
                 "After=%s\n",
-                netdev ? "remote-cryptsetup-pre.target" : "cryptsetup-pre.target");
+                netdev ? "remote-fs-pre.target" : "cryptsetup-pre.target");
 
         if (!nofail)
                 fprintf(f,
index 8494d23e9e4058c2d8ef8dcfc9aee0a3b314bf16..4e2ae3f302198cc89d1a639427d449bec7bd31fc 100644 (file)
@@ -48,7 +48,6 @@ units = [
         ['proc-sys-fs-binfmt_misc.mount',       'ENABLE_BINFMT'],
         ['reboot.target',                       '',
          'runlevel6.target ctrl-alt-del.target'],
-        ['remote-cryptsetup-pre.target',        'HAVE_LIBCRYPTSETUP'],
         ['remote-cryptsetup.target',            'HAVE_LIBCRYPTSETUP',
          join_paths(pkgsysconfdir, 'system/multi-user.target.wants/')],
         ['remote-fs-pre.target',                ''],
diff --git a/units/remote-cryptsetup-pre.target b/units/remote-cryptsetup-pre.target
deleted file mode 100644 (file)
index a375e61..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-#  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=Remote Encrypted Volumes (Pre)
-Documentation=man:systemd.special(7)
-RefuseManualStart=yes
-Before=remote-cryptsetup.target
-
-After=network.target network-online.target
-Wants=network-online.target
index c306d521f711fa58d3692bc7a4e65f7936e82ea5..d485b06726c127b967271e7d71cf1afaa210088e 100644 (file)
@@ -8,7 +8,7 @@
 [Unit]
 Description=Remote Encrypted Volumes
 Documentation=man:systemd.special(7)
-After=remote-cryptsetup-pre.target
+After=remote-fs-pre.target
 DefaultDependencies=no
 Conflicts=shutdown.target