aboutsummaryrefslogtreecommitdiffstats
path: root/chapter08/glibc.xml
diff options
context:
space:
mode:
authorXi Ruoyao <xry111@xry111.site>2023-09-14 16:48:46 +0800
committerXi Ruoyao <xry111@xry111.site>2023-09-14 16:50:37 +0800
commitba40e325667d24c3988ae5c0395c79a7fe73e6ea (patch)
tree9586eee47b07c096907dde964118e5bf3fd53c87 /chapter08/glibc.xml
parentefd11134bb9bfa33f3c64aee634b2232bee571d3 (diff)
systemd: Use NSS modules provided by systemd in nsswitch.conf
It allows a simplification to /etc/hosts. Also correct some info about FQDN in both sysv and systemd.
Diffstat (limited to 'chapter08/glibc.xml')
-rw-r--r--chapter08/glibc.xml20
1 files changed, 19 insertions, 1 deletions
diff --git a/chapter08/glibc.xml b/chapter08/glibc.xml
index f48d95d09..cf1a4bd59 100644
--- a/chapter08/glibc.xml
+++ b/chapter08/glibc.xml
@@ -320,7 +320,7 @@ localedef -i ja_JP -f SHIFT_JIS ja_JP.SJIS 2> /dev/null || true</userinput></scr
<para>Create a new file <filename>/etc/nsswitch.conf</filename> by running the
following:</para>
-<screen><userinput>cat &gt; /etc/nsswitch.conf &lt;&lt; "EOF"
+<screen revision='sysv'><userinput>cat &gt; /etc/nsswitch.conf &lt;&lt; "EOF"
<literal># Begin /etc/nsswitch.conf
passwd: files
@@ -338,6 +338,24 @@ rpc: files
# End /etc/nsswitch.conf</literal>
EOF</userinput></screen>
+<screen revision='systemd'><userinput>cat &gt; /etc/nsswitch.conf &lt;&lt; "EOF"
+<literal># Begin /etc/nsswitch.conf
+
+passwd: files systemd
+group: files systemd
+shadow: files systemd
+
+hosts: mymachines resolve [!UNAVAIL=return] files myhostname dns
+networks: files
+
+protocols: files
+services: files
+ethers: files
+rpc: files
+
+# End /etc/nsswitch.conf</literal>
+EOF</userinput></screen>
+
</sect3>
<sect3>