From ba40e325667d24c3988ae5c0395c79a7fe73e6ea Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Thu, 14 Sep 2023 16:48:46 +0800 Subject: 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. --- chapter08/glibc.xml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'chapter08/glibc.xml') 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 || trueCreate a new file /etc/nsswitch.conf by running the following: -cat > /etc/nsswitch.conf << "EOF" +cat > /etc/nsswitch.conf << "EOF" # Begin /etc/nsswitch.conf passwd: files @@ -335,6 +335,24 @@ services: files ethers: files rpc: files +# End /etc/nsswitch.conf +EOF + +cat > /etc/nsswitch.conf << "EOF" +# 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 EOF -- cgit v1.2.3-54-g00ecf