Skip to content

Commit

Permalink
GRMLBASE/98-clean-chroot: avoid warning messages with resolvconf <1.80
Browse files Browse the repository at this point in the history
In commit acf12d4 we got rid of /etc/resolvconf/run, and while
resolvconf >=1.80 no longer uses /etc/resolvconf/run, older
versions of resolvconf still use it in their libc update hook script. :-/

So while it really works e.g. on Debian/buster (as documented in
commit acf12d4) with resolvconf v1.79, there's an ugly:

| /etc/resolvconf/update.d/libc: Warning: /etc/resolv.conf is not a symbolic link to /etc/resolvconf/run/resolv.conf" for resolvconf versions

message when invoking "dhclient". Try to avoid this.

Related to grml/grml#142
  • Loading branch information
mika committed May 29, 2020
1 parent cb7d1f2 commit 6b2e23d
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion etc/grml/fai/config/scripts/GRMLBASE/98-clean-chroot
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,20 @@ else
echo "Setting up resolvconf"
rm -f "${target}"/etc/resolvconf/resolv.conf.d/original
rm -f "${target}"/etc/resolv.conf
ln -s /run/resolvconf/resolv.conf "${target}"/etc/resolv.conf

# avoid "/etc/resolvconf/update.d/libc: Warning: /etc/resolv.conf is not a
# symbolic link to /etc/resolvconf/run/resolv.conf" for resolvconf versions
# before 1.80
RESOLVCONF_VERSION=$($ROOTCMD dpkg-query -W -f='${Version}\n' resolvconf || true)
echo "-> Identified resolvconf version '${RESOLVCONF_VERSION}'"
if dpkg --compare-versions "${RESOLVCONF_VERSION}" lt 1.80 ; then
echo "-> Installing resolvconf symlink for versions <1.80"
ln -s /etc/resolvconf/run/resolv.conf "${target}"/etc/resolv.conf
else
echo "-> Installing resolvconf symlink for versions >=1.80"
ln -s /run/resolvconf/resolv.conf "${target}"/etc/resolv.conf
fi

fi

# make sure we don't leak any mdadm configurations
Expand Down

0 comments on commit 6b2e23d

Please sign in to comment.