diff options
author | Xi Ruoyao <xry111@xry111.site> | 2023-09-14 16:48:46 +0800 |
---|---|---|
committer | Xi Ruoyao <xry111@xry111.site> | 2023-09-14 16:50:37 +0800 |
commit | ba40e325667d24c3988ae5c0395c79a7fe73e6ea (patch) | |
tree | 9586eee47b07c096907dde964118e5bf3fd53c87 /chapter08/glibc.xml | |
parent | efd11134bb9bfa33f3c64aee634b2232bee571d3 (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.xml | 20 |
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 > /etc/nsswitch.conf << "EOF" +<screen revision='sysv'><userinput>cat > /etc/nsswitch.conf << "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 > /etc/nsswitch.conf << "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> |