Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More host symlinks for NSS #38

Merged
merged 1 commit into from
Sep 22, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions scripts/prefix-symlink-host-paths.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,23 @@ if [[ $EPREFIX != $EXPECTED_START/* ]]; then
exit 1
fi

# /etc/passwd: required to ensure local users are known (see https://github.com/EESSI/compatibility-layer/issues/15)
# /etc/group: required to ensure local user groups are known
for path in /etc/passwd /etc/group; do
paths=(
"/etc/passwd" # required to ensure local users are known (see https://github.com/EESSI/compatibility-layer/issues/15)
"/etc/group" # required to ensure local user groups are known
"/etc/nsswitch.conf" # required to ensure name-service information is taken from the right source (e.g. ldap)
"/etc/resolv.conf" # required to use the DNS resolver from the host (should be done automatically)
"/lib64/libnss_centrifydc.so.2" # required if Centrify is used in nsswitch.conf
"/lib64/libnss_ldap.so.2" # required if LDAP is used in nsswitch.conf
"/lib64/libnss_sss.so.2" # required if SSSD is used in nsswitch.conf
)

for path in ${paths[@]}; do
echo ">> checking $path ..."
ls -ld ${EPREFIX}$path | grep " -> $path" > /dev/null
ec=$?
if [ $ec -ne 0 ]; then
echo_yellow ">> [CHANGE] ${EPREFIX}$path is *not* a symlink to $path, fixing that..."
rm ${EPREFIX}$path
rm -f ${EPREFIX}$path
ln -s $path ${EPREFIX}$path
else
echo_green ">> [OK] ${EPREFIX}$path is already a symlink to $path"
Expand Down