From c2c0b1a042d376e0c6804ade7ac33125532a9318 Mon Sep 17 00:00:00 2001 From: Pavel Zhukov Date: Jul 31 2017 07:41:01 +0000 Subject: Recreate /etc/resolv.conf if NetworkManager screwed it up (#1475279) --- diff --git a/dhclient-script b/dhclient-script index 20e6d28..8ad3655 100644 --- a/dhclient-script +++ b/dhclient-script @@ -85,7 +85,7 @@ eventually_add_hostnames_domain_to_search() { done if [ "${is_in}" = "false" ]; then - # Add domain name to search list (#637763) + # Add domain name to search list (#637763) sed -i -e "s/${search}/${search} ${domain}/" "${RESOLVCONF}" fi fi @@ -728,6 +728,20 @@ get_hwaddr () fi } +validate_resolv_conf() +{ + # It's possible to have broken symbolic link $RESOLVCONF -> + # https://bugzilla.redhat.com/1475279 + # Remove broken link and hope NM will survive + if [ -h "${RESOLVCONF}" -a ! -e "${RESOLVCONF}" ]; + then + logmessage "${RESOLVCONF) is broken symlink. Recreating..." + unlink "${RESOLVCONF}" + touch "${RESOLVCONF}" + fi; +} + + get_config_by_hwaddr () { LANG=C grep -il "^[[:space:]]*HWADDR=\"\?${1}\"\?\([[:space:]#]\|$\)" /etc/sysconfig/network-scripts/ifcfg-* \ @@ -787,6 +801,8 @@ source_config () run_hook "${ETCDIR}/dhclient-enter-hooks" || exit $? run_hookdir "${ETCDIR}/dhclient-enter-hooks.d" || exit $? +[ "${PEERDNS}" = "no" ] || validate_resilv_conf() + if [ -f /etc/sysconfig/network ]; then . /etc/sysconfig/network fi diff --git a/dhcp.spec b/dhcp.spec index 1459023..6367e55 100644 --- a/dhcp.spec +++ b/dhcp.spec @@ -20,7 +20,7 @@ Summary: Dynamic host configuration protocol software Name: dhcp Version: 4.3.6 %global VERSION %%{version}%%{prever} -Release: 2%{?dist} +Release: 3%{?dist} # NEVER CHANGE THE EPOCH on this package. The previous maintainer (prior to # dcantrell maintaining the package) made incorrect use of the epoch and # that's why it is at 12 now. It should have never been used, but it was. @@ -661,9 +661,14 @@ done %endif %changelog + +* Thu Jul 27 2017 Pavel Zhukov - 12:4.3.6-3 +- Recreate /etc/resolv.conf if NetworkManager screwed it up (#1475279) + * Wed Jul 26 2017 Fedora Release Engineering - 12:4.3.6-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + * Fri Jul 14 2017 Pavel Zhukov - 12:4.3.6-1 - New version 4.3.6