On Tue, 2018-07-17 at 22:32 -0400, Colin Walters wrote:
See discussion in https://github.com/projectatomic/rpm-ostree/pull/14 64 Is there a reason that the `symlink` mode doesn't default to creating a symlink? It'd help for mounting `/etc` read-only.
Hi,
Writing /etc/resolv.conf as symlink, is an action reserved to the
administrator. The symlink is intent/configuration of the administrator
that /etc/resolv.conf is managed by a particular component.
NetworkManager should not write such intent, it's reserved to the
admin.
See in particular the commit message of [1] and bug [2].
According to NetworkManager manual [4]:
1) if /etc/resolv.conf is already a symlink, the symlink will not be
changed.
- with "rc-manager=file", NM would follow the symlink, and write the
file it points to.
- with "rc-manager=symlink", NM would not modify the symlink at all.
I older versions, there were cases, where this was not true (see [1],
[3]).
2) NetworkManager will never create /etc/resolv.conf to be a symlink.
In older versions, that was not the always the case [1].
3) Noteable exception: with rc-manager=symlink and /etc/resolv.conf
being a symlink to "/var/run/NetworkManager/resolv.conf", then
NetworkManager will replace the symlink with a symlink to the same file
(to trigger an inotify notification).
Why is there a problem with "mounting `/etc` read-only"?
Note that behavior of NetworkManager was slightly refined in recent
versions. So, depending on which version of NetworkManager, the optimal
answer might differ slightly. On recent versions, just set rc-
manager=symlink, and symlink /etc/resolv.conf to
"../var/run/NetworkManager/resolv.conf" (beware that it does not
literally point to "/var/run/NetworkManager/resolv.conf").
[1]
https://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=15177a34be297654086005f2d796e6a4c6a1b918
[2] https://bugzilla.redhat.com/show_bug.cgi?id=1367551
[3]
https://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=644aa42f68d9d6f30144dba243f95690226a777c
[4] https://developer.gnome.org/NetworkManager/unstable/NetworkManager.conf.html
best,
ThomasAttachment:
signature.asc
Description: This is a digitally signed message part