]> err.no Git - systemd/commitdiff
units: introduce local-fs-pre.target and remote-fs-pre.target
authorLennart Poettering <lennart@poettering.net>
Tue, 11 Oct 2011 01:33:53 +0000 (03:33 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 11 Oct 2011 01:33:53 +0000 (03:33 +0200)
This hook target enables services to order themselves between
network.target and remote mounts, which is needed for GFS2 and similar
systems.

Makefile.am
man/systemd.special.xml.in
src/mount.c
src/special.h

index f4a17aa7f53b6e1269a59eced2b89534e2f23e6d..3a98c5b06175903665ad08e33380be14f9c658d0 100644 (file)
@@ -337,7 +337,9 @@ dist_systemunit_DATA = \
        units/halt.target \
        units/kexec.target \
        units/local-fs.target \
+        units/local-fs-pre.target \
        units/remote-fs.target \
+        units/remote-fs-pre.target \
        units/cryptsetup.target \
        units/network.target \
        units/nss-lookup.target \
index 218754051e945831a36c9b9981290d9edf60d07a..116a43ccfb30798e6570fdeb43df6ac2963c962c 100644 (file)
@@ -59,6 +59,7 @@
                 <filename>halt.target</filename>,
                 <filename>kbrequest.target</filename>,
                 <filename>local-fs.target</filename>,
+                <filename>local-fs-pre.target</filename>,
                 <filename>mail-transfer-agent.target</filename>,
                 <filename>multi-user.target</filename>,
                 <filename>network.target</filename>,
@@ -66,6 +67,7 @@
                 <filename>poweroff.target</filename>,
                 <filename>reboot.target</filename>,
                 <filename>remote-fs.target</filename>,
+                <filename>remote-fs-pre.target</filename>,
                 <filename>rescue.target</filename>,
                 <filename>rpcbind.target</filename>,
                 <filename>runlevel2.target</filename>,
                                         facility.</para>
                                 </listitem>
                         </varlistentry>
+                        <varlistentry>
+                                <term><filename>local-fs-pre.target</filename></term>
+                                <listitem>
+                                        <para>This target unit is
+                                        automatically ordered before
+                                        all local mount points marked
+                                        with <option>auto</option>
+                                        (see above). It can be used to
+                                        execute certain units before
+                                        all local mounts.</para>
+                                </listitem>
+                        </varlistentry>
                         <varlistentry>
                                 <term><filename>mail-transfer-agent.target</filename></term>
                                 <listitem>
                                         facility.</para>
                                 </listitem>
                         </varlistentry>
+                        <varlistentry>
+                                <term><filename>remote-fs-pre.target</filename></term>
+                                <listitem>
+                                        <para>This target unit is
+                                        automatically ordered before
+                                        all remote mount points marked
+                                        with <option>auto</option>
+                                        (see above). It can be used to
+                                        execute certain units before
+                                        all remote mounts.</para>
+                                </listitem>
+                        </varlistentry>
                         <varlistentry>
                                 <term><filename>rescue.target</filename></term>
                                 <listitem>
index 2fc799a6ed58cfc0a636fd6a80c6dea9759365ba..ef953f0d0aecdabc44f04a16b21e254a3de098f8 100644 (file)
@@ -357,9 +357,11 @@ static int mount_add_fstab_links(Mount *m) {
 
         if (mount_is_network(p)) {
                 target = SPECIAL_REMOTE_FS_TARGET;
-                after = SPECIAL_NETWORK_TARGET;
-        } else
+                after = SPECIAL_REMOTE_FS_PRE_TARGET;
+        } else {
                 target = SPECIAL_LOCAL_FS_TARGET;
+                after = SPECIAL_LOCAL_FS_PRE_TARGET;
+        }
 
         if (!path_equal(m->where, "/"))
                 if ((r = unit_add_two_dependencies_by_name(UNIT(m), UNIT_BEFORE, UNIT_CONFLICTS, SPECIAL_UMOUNT_TARGET, NULL, true)) < 0)
index 614e53ca1bcd4bf185de9f835ec9da84b84157d2..3fe34c955ca9cd2b3c44a5868abb18a4e5d31483 100644 (file)
@@ -45,7 +45,9 @@
 #define SPECIAL_SYSINIT_TARGET "sysinit.target"
 #define SPECIAL_SOCKETS_TARGET "sockets.target"
 #define SPECIAL_LOCAL_FS_TARGET "local-fs.target"         /* LSB's $local_fs */
+#define SPECIAL_LOCAL_FS_PRE_TARGET "local-fs-pre.target"
 #define SPECIAL_REMOTE_FS_TARGET "remote-fs.target"       /* LSB's $remote_fs */
+#define SPECIAL_REMOTE_FS_PRE_TARGET "remote-fs-pre.target"
 #define SPECIAL_SWAP_TARGET "swap.target"
 #define SPECIAL_BASIC_TARGET "basic.target"