Re: defaulting `rc_manager=symlink` to creating a symlink?

On Tue, 2018-07-17 at 22:32 -0400, Colin Walters wrote:
See discussion in

Is there a reason that the `symlink` mode doesn't default to creating
a symlink?  It'd help for mounting `/etc` read-only.


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

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
  - 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],

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").



Attachment: signature.asc
Description: This is a digitally signed message part

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]