Thanks All!
Ok, so configured auditd to watch /etc/resolv.conf and that pointed out
the problem.
A host that was reverting my changes had these /etc/resolv.conf* files:
[root@mdskvm-p01 etc]# grep -EiR "# Generated by NetworkManager" *
grep: extlinux.conf: No such file or directory
resolv.conf:# Generated by NetworkManager
resolv.conf.save:# Generated by NetworkManager #
<<<<<<<<<<<<<<<
[root@mdskvm-p01 etc]#
[root@mdskvm-p01 etc]# grep -Ei search resolv.conf resolv.conf.save
resolv.conf:search mds.xyz nix.mds.xyz mws.mds.xyz
resolv.conf.save:search mds.xyz
[root@mdskvm-p01 etc]#
and a host where changes to /etc/resolv.conf were not occurring, had
these files (note the missing .save file):
[root@mdskvm-p02 etc]# grep -EiR "# Generated by NetworkManager" *
grep: extlinux.conf: No such file or directory
resolv.conf:# Generated by NetworkManager
resolv.conf-original:# Generated by NetworkManager
[root@mdskvm-p02 etc]#
The reason why /etc/resolv.conf was reverting on the first host is
because there is a line in the following ifdown-post network script that
overwrites /etc/resolv.conf from /etc/resolv.conf.save, if you have it:
[root@mdskvm-p02 network-scripts]# vi ifdown-post
.
.
.
# Remove duplicate DNS entries and shift them,
# to have always correct condition below...
update_DNS_entries
if ! is_false "${PEERDNS}" || is_true "${RESOLV_MODS}" && \
[ "${DEVICETYPE}" = "ppp" -o "${DEVICETYPE}" =
"ippp" -o -n "${DNS1}" \
-o "${BOOTPROTO}" = "bootp" -o "${BOOTPROTO}" =
"dhcp" ] ; then
if [ -f /etc/resolv.conf.save ]; then #
<<<<<<<<<<<<<<<<<<<<<
change_resolv_conf /etc/resolv.conf.save
rm -f /etc/resolv.conf.save #
<<<<<<<<<<<<<<<<<<<<<
fi
if [ "${DEVICETYPE}" = "ppp" -o "${DEVICETYPE}" =
"ippp" ]; then
if [ -f /etc/ppp/peers/$DEVICE ] ; then
rm -f /etc/ppp/peers/$DEVICE
fi
fi
fi
.
.
.
.
And the function change_resolv_conf() effectively copies the contents of
/etc/resolv.conf.save over /etc/resolv.conf thereby overwriting anything
in it, if it exists (See #
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
markers below ):
[root@mdskvm-p02 network-scripts]# vi network-functions
# Invoke this when /etc/resolv.conf has changed:
change_resolv_conf ()
{
s=$(/bin/grep '^[\ \ ]*option' /etc/resolv.conf 2>/dev/null)
if [ $# -gt 1 ]; then
if [ "x$s" != "x" ]; then
s="$s"$'\n'
fi
n_args=$#
while [ $n_args -gt 0 ]; do
case "$s" in
*$1*)
shift
n_args=$(($n_args-1))
continue
;;
esac
s="$s$1"
shift
if [ $# -gt 0 ]; then
s="$s"$'\n'
fi
n_args=$(($n_args-1))
done
elif [ $# -eq 1 ]; then
if [ "x$s" != "x" ]; then
s="$s"$'\n'$(/bin/grep -vF "$s" $1)
else #
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
s=$(cat $1)
fi #
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
fi
(echo "$s" > /etc/resolv.conf) >/dev/null 2>&1; #
<<<<<<<<<<<<<<<<<
r=$?
if [ $r -eq 0 ]; then
[ -x /sbin/restorecon ] && /sbin/restorecon /etc/resolv.conf
/dev/null 2>&1 # reset the correct context
/usr/bin/logger -p local7.notice -t "NET" -i "$0 : updated
/etc/resolv.conf"
[ -e /var/run/nscd/socket ] && /usr/sbin/nscd -i hosts #
invalidate cache
fi
return $r
}
So you have to modify both files in order to persist the changes or
simply remove the /etc/resolv.conf.save file..... Appears when some
older interface parameters were used before I installed oVirt here, they
triggered creation of the .save file. Because it exists, it's simply
used by default. Hence why changes directly to /etc/resolv.conf
persisted on the second host: it didn't have a /etc/resolv.conf.save file.
Cheers,
TK
More notes and configuring auditd to watch changes to /etc/resolv.conf:
https://tinyurl.com/y68dgecx
On 9/22/2019 11:08 AM, Bell Levin wrote:
Hey,
I would like to add a small point to Edward's explanation.
If the config does really get overwritten, it probably means that more
was changed to the bond but the search string.
If indeed what you are looking for is to add a dns search line, you
should add it to /etc/resolv.conf.
On Sun, Sep 22, 2019 at 4:44 PM Edward Berger <edwberger(a)gmail.com
<mailto:edwberger@gmail.com>> wrote:
vdsm creates persistant network configs that overwrite manual
changes at reboot
in /var/lib/vdsm/persistence/netconf
You can check your other hosts for any differences there.
It is recommended that networks are set up and managed through ovirt
engine.
On Sun, Sep 22, 2019 at 6:01 AM TomK <tomkcpr(a)mdevsys.com
<mailto:tomkcpr@mdevsys.com>> wrote:
This occurs on only one of the oVirt hosts in my cluster.
--
Thx,
TK.
On 9/22/2019 12:08 AM, TomK wrote:
> Hey All,
>
> My ifcfg-bond0 is getting overwritten on reboot. Need to add
a search
> string to the configuration.
>
> What's overwriting it and should I be trying to add a search
string to
> another location?
>
_______________________________________________
Users mailing list -- users(a)ovirt.org <mailto:users@ovirt.org>
To unsubscribe send an email to users-leave(a)ovirt.org
<mailto:users-leave@ovirt.org>
Privacy Statement:
https://www.ovirt.org/site/privacy-policy/
oVirt Code of Conduct:
https://www.ovirt.org/community/about/community-guidelines/
List Archives:
https://lists.ovirt.org/archives/list/users@ovirt.org/message/K5QTMQX4OGC...
_______________________________________________
Users mailing list -- users(a)ovirt.org <mailto:users@ovirt.org>
To unsubscribe send an email to users-leave(a)ovirt.org
<mailto:users-leave@ovirt.org>
Privacy Statement:
https://www.ovirt.org/site/privacy-policy/
oVirt Code of Conduct:
https://www.ovirt.org/community/about/community-guidelines/
List Archives:
https://lists.ovirt.org/archives/list/users@ovirt.org/message/DXIDOP24DKP...
_______________________________________________
Users mailing list -- users(a)ovirt.org
To unsubscribe send an email to users-leave(a)ovirt.org
Privacy Statement:
https://www.ovirt.org/site/privacy-policy/
oVirt Code of Conduct:
https://www.ovirt.org/community/about/community-guidelines/
List Archives:
https://lists.ovirt.org/archives/list/users@ovirt.org/message/52M6CUBRKRP...
--
Thx,
TK.