[BlueOnyx:23440] Re: 5210R looses resolv.conf

Michael Stauber mstauber at blueonyx.it
Tue Nov 12 21:07:14 -05 2019


Hi Maurice,

> easy-migrate --mysql
> is run, the output looks normal:
> 
> [MYSQL_MIGRATION_START] Starting Migration of MySQL users and databases.
> [MYSQL_MIGRATION_END] Migration of MySQL users and databases finished.
> Done!
> 
> But no databases neither users are imported, and resolv.conf gets
> overwritten
Two things there: If no MySQL was migrated during that run, then MySQLd
is either not running on the target server or the "root" MySQL password
that's set in the GUI isn't working.

As for /etc/resolv.conf and NetworkManager: I just tried it on two
different boxes. One installed off the ISO and one OpenVZ 7 OS template.
Both did NOT loose the edits in /etc/resolv.conf on an easy-migrate
MySQL import.

BUT:
====

They lost them if I did a "systemctl reload NetworkManager".

They retained them if I did a "systemctl restart NetworkManager".

Fun and games, right?

So I went digging and found several approaches. But the best appears to
be to configure NetworkManager to leave /etc/resolv.conf alone entirely
and to add our own mechanism to manage /etc/resolv.conf to it instead.

I just published yet another base-system-* Update that's now available
on YUM for 5210R. This time it requires a new RPM that I just added.
It's called "blueonyx-nm-resolver" and contains these files:

]# rpm -ql blueonyx-nm-resolver
/etc/NetworkManager/conf.d/no-dns.conf
/etc/NetworkManager/dispatcher.d/50-blueonyx
/usr/sausalito/sbin/refresh_resolver.pl

/usr/sausalito/sbin/refresh_resolver.pl reads the "System" Object in
CODB and writes out a fresh /etc/resolv.conf.

/etc/NetworkManager/conf.d/no-dns.conf tells NetworkManager to mind its
own business and not to mess with DNS.

/etc/NetworkManager/dispatcher.d/50-blueonyx is a plugin that on Network
"up" or "down" transactions checks /etc/resolv.conf and if it finds zero
nameserver lines in it, then it'll run
/usr/sausalito/sbin/refresh_resolver.pl to create a new copy of
/etc/resolv.conf

In essence this achieves the following:

systemctl restart|start|stop NetworkManager will all create a fresh
/etc/resolv.conf that contains the DNS settings configured in the GUI.
Same for "ifup <interface>" or "ifdown <interface>".

systemctl reload NetworkManager will now no longer mess with
/etc/resolv.conf at all.

So please do a "yum clean all" and a "yum update" and then see if that
fixes the problems for you.

-- 
With best regards

Michael Stauber



More information about the Blueonyx mailing list