chiark / gitweb /
units: introduce network-pre.target as place to hook in firewalls
authorLennart Poettering <lennart@poettering.net>
Wed, 11 Jun 2014 09:33:02 +0000 (11:33 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 11 Jun 2014 10:14:55 +0000 (12:14 +0200)
network-pre.target is a passive target that should be pulled in by
services that want to be executed before any network is configured (for
example: firewall scrips).

network-pre.target should be ordered before all network managemet
services (but not be pulled in by them).

network-pre.target should be order after all services that want to be
executed before any network is configured (and be pulled in by them).

Makefile.am
man/systemd.special.xml
units/local-fs.target
units/network-pre.target [new file with mode: 0644]
units/network.target
units/systemd-networkd.service.in

index 3ea95e94808c42f484d6de8c941ffbbac265b353..8514ec957283d8e833acbe6c8f3bd3b5811cac9a 100644 (file)
@@ -413,6 +413,7 @@ dist_systemunit_DATA = \
        units/remote-fs.target \
        units/remote-fs-pre.target \
        units/network.target \
+       units/network-pre.target \
        units/network-online.target \
        units/nss-lookup.target \
        units/nss-user-lookup.target \
index 38b94a7657ed49a86c4390f7f4734e714f285467..cda6edd42b54a4d543403a12bd9c8076d7a726e6 100644 (file)
@@ -72,6 +72,7 @@
                 <filename>multi-user.target</filename>,
                 <filename>network.target</filename>,
                 <filename>network-online.target</filename>,
+                <filename>network-pre.target</filename>,
                 <filename>nss-lookup.target</filename>,
                 <filename>nss-user-lookup.target</filename>,
                 <filename>paths.target</filename>,
                                         facility.</para>
                                 </listitem>
                         </varlistentry>
+                        <varlistentry>
+                                <term><filename>network-pre.target</filename></term>
+                                <listitem>
+                                        <para>This passive target unit
+                                        may be pulled in by services
+                                        that want to run before any
+                                        network is set up, for example
+                                        for the purpose of setting up a
+                                        firewall. All network
+                                        management software orders
+                                        itself after this target, but
+                                        does not pull it in.</para>
+                                </listitem>
+                        </varlistentry>
                         <varlistentry>
                                 <term><filename>nss-lookup.target</filename></term>
                                 <listitem>
index ae3cedcb6584351d2faed23d17578dfcac9a4b73..70cb13f25d4be4db4046a51ed11fe27336254ece 100644 (file)
@@ -9,7 +9,5 @@
 Description=Local File Systems
 Documentation=man:systemd.special(7)
 After=local-fs-pre.target
-DefaultDependencies=no
-Conflicts=shutdown.target
 OnFailure=emergency.target
 OnFailureJobMode=replace-irreversibly
diff --git a/units/network-pre.target b/units/network-pre.target
new file mode 100644 (file)
index 0000000..0ea4bc7
--- /dev/null
@@ -0,0 +1,12 @@
+#  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=Network (Pre)
+Documentation=man:systemd.special(7)
+Documentation=http://www.freedesktop.org/wiki/Software/systemd/NetworkTarget
+RefuseManualStart=yes
index 65fc64b02cf54a92703f05d7f8e6e31e55672bac..61ebdcadd0b39ce0ddff7e34ed4977c24ff8092c 100644 (file)
@@ -9,3 +9,5 @@
 Description=Network
 Documentation=man:systemd.special(7)
 Documentation=http://www.freedesktop.org/wiki/Software/systemd/NetworkTarget
+After=network-pre.target
+RefuseManualStart=yes
index 373ac4e0fd1905eea4fa7ed6e531eeaa04b64649..48f4d63a8727a3073799a1512b821db0bcabc600 100644 (file)
@@ -9,7 +9,7 @@
 Description=Network Service
 Documentation=man:systemd-networkd.service(8)
 DefaultDependencies=no
-After=dbus.service
+After=dbus.service network-pre.target
 Before=network.target
 Wants=network.target
 ConditionCapability=CAP_NET_ADMIN