Skip to content
Snippets Groups Projects
Commit 4ec2bb4e authored by Lars Seipel's avatar Lars Seipel
Browse files

runner/libvirt: ensure /etc/resolv.conf is regular file

For the OOB management server, that is. We want
NetworkManager to write the resolvers received from DHCP to
/etc/resolv.conf so that dnsmasq can read them from there.
parent e735d9a9
Branches
Tags
No related merge requests found
...@@ -156,6 +156,12 @@ func writeExtraMgmtServerCommands(w io.Writer, d *device) { ...@@ -156,6 +156,12 @@ func writeExtraMgmtServerCommands(w io.Writer, d *device) {
io.WriteString(w, "write /etc/dnsmasq.conf:"+ io.WriteString(w, "write /etc/dnsmasq.conf:"+
strings.Replace(dnsmasqConf, "\n", "\\\n", -1)+"\n") strings.Replace(dnsmasqConf, "\n", "\\\n", -1)+"\n")
io.WriteString(w, "run-command systemctl disable systemd-resolved.service\n") io.WriteString(w, "run-command systemctl disable systemd-resolved.service\n")
// Ensure /etc/resolv.conf is a regular file (and not a symlink to
// systemd-resolved's stub-resolv.conf). Dnsmasq reads its upstream
// resolvers from resolv.conf and we need NM to write the ones received
// from DHCP there.
io.WriteString(w, "delete /etc/resolv.conf\n")
io.WriteString(w, "write /etc/resolv.conf:#placeholder\n")
io.WriteString(w, "run-command systemctl enable dnsmasq.service\n") io.WriteString(w, "run-command systemctl enable dnsmasq.service\n")
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment