systemd-resolved and dcos-gen-resolvconf.service can argue over /etc/resolv.conf

Description

On CoreOS (and possibly ALL systemd based Linux distributions), by default, systemd-resolved manages /etc/resolv.conf, which is a link to /run/systemd/resolve/resolv.conf.

Many people in the DC/OS community seem to be disabling and even masking systemd-resolved to prevent it from modifying /etc/resolv.conf, so that the dcos-gen-resolvconf.service from spartan can handle it.

After reading the man pages for systemd-resolved it appears that the correct course of action is to simply remove the softlink version of /etc/resolv.conf and replace it with a real file. This tells systemd-resolved to leave that file alone, but allows it to continue to do the rest of it's job as needed by networkd.

This could be handled in a few ways. The best might simply be to handle this in the dcos-installer (copy the contents of the link, into a standard file and then delete and replace /etc/resolv.conf).

This was someone can still change this however they want later. The other option would be to make the dcos-gen-resolvconf.service smarter, and have it do this job, if /etc/resolv.conf is ever a link. This means that it would likely always revert the file and removes links, which might be ok, but is obviously a bit more aggressive.

Assignee

Cody Maloney
Configure