]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
man: recommend that .network or friends should have a numeric prefix
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 17 Apr 2022 18:08:55 +0000 (03:08 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 17 Apr 2022 19:30:49 +0000 (04:30 +0900)
Closes #23105.

man/systemd.link.xml
man/systemd.netdev.xml
man/systemd.network.xml

index 5629057bf2640eeafd179a77d68d4b908710058e..de23b941ad2dcf40527e15eb6c2f638e3e386b50 100644 (file)
     <citerefentry><refentrytitle>systemd.syntax</refentrytitle><manvolnum>7</manvolnum></citerefentry> for a
     general description of the syntax.</para>
 
-    <para>The link files are read from the files located in the system network directory
-    <filename>/usr/lib/systemd/network</filename>, the volatile runtime network directory
+    <para>The <filename>.link</filename> files are read from the files located in the system network
+    directory <filename>/usr/lib/systemd/network</filename> and
+    <filename>/usr/local/lib/systemd/network</filename>, the volatile runtime network directory
     <filename>/run/systemd/network</filename>, and the local administration network directory
-    <filename>/etc/systemd/network</filename>. Link files must have the extension
-    <filename>.link</filename>; other extensions are ignored. All link files are collectively sorted
-    and processed in lexical order, regardless of the directories in which they live. However, files
-    with identical filenames replace each other. Files in <filename>/etc/</filename> have the highest
-    priority, files in <filename>/run/</filename> take precedence over files with the same name in
-    <filename>/usr/lib/</filename>. This can be used to override a system-supplied link file with a
+    <filename>/etc/systemd/network</filename>. All configuration files are collectively sorted and
+    processed in alphanumeric order, regardless of the directories in which they live. However, files
+    with identical filenames replace each other. It is recommended that each filename is prefixed with
+    a number (e.g. <filename>10-eth0.link</filename>). Otherwise, the default
+    <filename>.link</filename> files or those generated by
+    <citerefentry><refentrytitle>systemd-network-generator.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
+    may take precedence over user configured files. Files in <filename>/etc/</filename> have the
+    highest priority, files in <filename>/run/</filename> take precedence over files with the same name
+    in <filename>/usr/lib/</filename>. This can be used to override a system-supplied link file with a
     local file if needed. As a special case, an empty file (file size 0) or symlink with the same name
     pointing to <filename>/dev/null</filename> disables the configuration file entirely (it is
     "masked").</para>
   <refsect1>
     <title>[Match] Section Options</title>
 
-    <para>A link file is said to match a device if all matches specified by the
-    [Match] section are satisfied. When a link file does not contain valid settings
-    in [Match] section, then the file will match all devices and
-    <command>systemd-udevd</command> warns about that. Hint: to avoid the warning and to make it clear
-    that all interfaces shall be matched, add the following:
+    <para>A link file is said to match an interface if all matches specified by the [Match] section are
+    satisfied. When a link file does not contain valid settings in [Match] section, then the file will
+    match all interfaces and <command>systemd-udevd</command> warns about that. Hint: to avoid the
+    warning and to make it clear that all interfaces shall be matched, add the following:
     <programlisting>OriginalName=*</programlisting>
-    The following keys are accepted:</para>
+    The first (in alphanumeric order) of the link files that matches a given interface is applied, all
+    later files are ignored, even if they match as well. The following keys are accepted:</para>
 
     <variablelist class='network-directives'>
       <!-- This list is reused in systemd.network(3), hence maintain a specific order:
@@ -1211,6 +1215,9 @@ MACAddress=cb:a9:87:65:43:21</programlisting>
       </citerefentry>,
       <citerefentry>
         <refentrytitle>systemd.network</refentrytitle><manvolnum>5</manvolnum>
+      </citerefentry>,
+      <citerefentry>
+        <refentrytitle>systemd-network-generator.service</refentrytitle><manvolnum>8</manvolnum>
       </citerefentry>
     </para>
   </refsect1>
index ace1dc63367d6f812abc3228031a15f400a6b693..3a776b3f42190702e6cecf6b7401415bedb5e424 100644 (file)
     than create its own. Note that the settings of the pre-existing netdev will not be changed by
     networkd.</para>
 
-    <para>The <filename>.netdev</filename> files are read from the files located in the system
-    network directory <filename>/usr/lib/systemd/network</filename>, the volatile runtime network
-    directory <filename>/run/systemd/network</filename> and the local administration network
-    directory <filename>/etc/systemd/network</filename>. All configuration files are collectively
-    sorted and processed in lexical order, regardless of the directories in which they live.
-    However, files with identical filenames replace each other. Files in <filename>/etc/</filename>
-    have the highest priority, files in <filename>/run/</filename> take precedence over files with
-    the same name in <filename>/usr/lib/</filename>. This can be used to override a system-supplied
-    configuration file with a local file if needed. As a special case, an empty file (file size 0)
-    or symlink with the same name pointing to <filename>/dev/null</filename> disables the
-    configuration file entirely (it is "masked").</para>
+    <para>The <filename>.netdev</filename> files are read from the files located in the system network
+    directory <filename>/usr/lib/systemd/network</filename> and
+    <filename>/usr/local/lib/systemd/network</filename>, the volatile runtime network directory
+    <filename>/run/systemd/network</filename> and the local administration network directory
+    <filename>/etc/systemd/network</filename>. All configuration files are collectively sorted and
+    processed in alphanumeric order, regardless of the directories in which they live. However, files
+    with identical filenames replace each other. It is recommended that each filename is prefixed with
+    a number (e.g. <filename>10-vlan.netdev</filename>). Otherwise, <filename>.netdev</filename> files
+    generated by
+    <citerefentry><refentrytitle>systemd-network-generator.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
+    may take precedence over user configured files. Files in <filename>/etc/</filename> have the
+    highest priority, files in <filename>/run/</filename> take precedence over files with the same name
+    in <filename>/usr/lib/</filename>. This can be used to override a system-supplied configuration
+    file with a local file if needed. As a special case, an empty file (file size 0) or symlink with
+    the same name pointing to <filename>/dev/null</filename> disables the configuration file entirely
+    (it is "masked").</para>
 
     <para>Along with the netdev file <filename>foo.netdev</filename>, a "drop-in" directory
     <filename>foo.netdev.d/</filename> may exist. All files with the suffix <literal>.conf</literal>
@@ -2433,7 +2438,8 @@ Independent=yes</programlisting>
       <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
       <citerefentry><refentrytitle>systemd-networkd</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
       <citerefentry><refentrytitle>systemd.link</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
-      <citerefentry><refentrytitle>systemd.network</refentrytitle><manvolnum>5</manvolnum></citerefentry>
+      <citerefentry><refentrytitle>systemd.network</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
+      <citerefentry><refentrytitle>systemd-network-generator.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
     </para>
   </refsect1>
 
index daab872fdd3a49afc9babdff3b147f9ac4fa67d3..4f1c9e4b27f0dd8fd22d141f39b81d45359460e8 100644 (file)
     <filename>/usr/local/lib/systemd/network</filename>, the volatile runtime network directory
     <filename>/run/systemd/network</filename> and the local administration network directory
     <filename>/etc/systemd/network</filename>. All configuration files are collectively sorted and
-    processed in lexical order, regardless of the directories in which they live. However, files with
-    identical filenames replace each other. Files in <filename>/etc/</filename> have the highest
+    processed in alphanumeric order, regardless of the directories in which they live. However, files
+    with identical filenames replace each other. It is recommended that each filename is prefixed with
+    a number (e.g. <filename>10-eth0.network</filename>). Otherwise, the default
+    <filename>.network</filename> files or those generated by
+    <citerefentry><refentrytitle>systemd-network-generator.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
+    may take precedence over user configured files. Files in <filename>/etc/</filename> have the highest
     priority, files in <filename>/run/</filename> take precedence over files with the same name under
     <filename>/usr/</filename>. This can be used to override a system-supplied configuration file with
     a local file if needed. As a special case, an empty file (file size 0) or symlink with the same
@@ -69,9 +73,9 @@
     <title>[Match] Section Options</title>
 
     <para>The network file contains a [Match] section, which determines if a given network file may
-    be applied to a given device; and a [Network] section specifying how the device should be
-    configured. The first (in lexical order) of the network files that matches a given device is
-    applied, all later files are ignored, even if they match as well.</para>
+    be applied to a given interface; and a [Network] section specifying how the interface should be
+    configured. The first (in alphanumeric order) of the network files that matches a given interface
+    is applied, all later files are ignored, even if they match as well.</para>
 
     <para>A network file is said to match a network interface if all matches specified by the [Match]
     section are satisfied. When a network file does not contain valid settings in [Match] section, then
@@ -4774,6 +4778,7 @@ Xfrm=xfrm0</programlisting>
       <citerefentry><refentrytitle>systemd-networkd.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
       <citerefentry><refentrytitle>systemd.link</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
       <citerefentry><refentrytitle>systemd.netdev</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
+      <citerefentry><refentrytitle>systemd-network-generator.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
       <citerefentry><refentrytitle>systemd-resolved.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
     </para>
   </refsect1>