Prevent resolvconf(8) from stomping all over our newly generated

resolv.conf and subsequent updates.
This commit is contained in:
Warren Baker 2014-12-19 22:37:29 +02:00 committed by Chris Buechler
parent 792dbafd7b
commit 0000cdf7bd
2 changed files with 14 additions and 0 deletions

View File

@ -182,6 +182,15 @@ function system_resolvconf_generate($dynupdate = false) {
fwrite($fd, $resolvconf);
fclose($fd);
// Prevent resolvconf(8) from rewriting our resolv.conf
$fd = fopen("{$g['varetc_path']}/resolvconf.conf", "w");
if (!$fd) {
printf("Error: cannot open resolvconf.conf in system_resolvconf_generate().\n");
return 1;
}
fwrite($fd, "resolv_conf=\"/dev/null\"\n");
fclose($fd);
if (!platform_booting()) {
/* restart dhcpd (nameservers may have changed) */
if (!$dynupdate)

5
etc/rc
View File

@ -273,6 +273,11 @@ if [ ! -L /etc/resolv.conf ]; then
/bin/ln -s /var/etc/resolv.conf /etc/resolv.conf
fi
if [ ! -L /etc/resolvconf.conf ]; then
/bin/rm -rf /etc/resolvconf.conf
/bin/ln -s /var/etc/resolvconf.conf /etc/resolvconf.conf
fi
# Setup compatibility link for packages that
# have trouble overriding the PREFIX configure
# argument since we build our packages in a