Commit 20a4e81 1 parent 27d14da commit 20a4e81 Copy full SHA for 20a4e81
File tree 1 file changed +16
-5
lines changed
toolkit/perfsonar-toolkit/scripts/system_environment/testpoint
1 file changed +16
-5
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
# ######################
3
- # Enable systemd-reloved and make sure the old nscd is disabled
3
+ # Enable systemd-resolved and make sure the old nscd is disabled
4
4
# ######################
5
5
6
6
systemctl disable --now nscd 2> /dev/null
7
7
systemctl enable --now systemd-resolved
8
- grep -q -e ' ^hosts:\s\+.*resolve.*$' /etc/nsswitch.conf
9
- if [ $? -eq 1 ]; then
10
- sed -i -E ' s/^hosts:(\s+)(.+)$/hosts:\1resolve \2/g' /etc/nsswitch.conf
11
- fi
8
+
9
+ # Put resolved into the name service switch configuration. It needs
10
+ # to go before 'files' because, even though systemd-resolved claims to
11
+ # synthesize entries for the local system, it doesn't. That causes
12
+ # problems trying to resolve the local host's name.
13
+
14
+ # Steps:
15
+ # - Remove any instance of 'resolve'
16
+ # - If there's a 'files' insert 'resolve' after that
17
+ # - If there's no 'files', insert 'resolve' first
18
+ sed -i -E \
19
+ -e ' /^hosts:/ s/resolve[[:space:]]?//' \
20
+ -e ' /^hosts:.*files/ s/files/files resolve/' \
21
+ -e ' /^hosts:.*files/! s/^(hosts:[[:space:]]*)/\1resolve /' \
22
+ /etc/nsswitch.conf
You can’t perform that action at this time.
0 commit comments