diff options
author | Thomas Haller <thaller@redhat.com> | 2017-02-10 16:30:59 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2017-02-14 17:45:55 +0100 |
commit | 15177a34be297654086005f2d796e6a4c6a1b918 (patch) | |
tree | 0f603d472e999f17dcfb7056b4630b9f201ada27 /man | |
parent | 97cdb690f2db0c5de934403147b0dbc1bf4f7904 (diff) | |
download | NetworkManager-15177a34be297654086005f2d796e6a4c6a1b918.tar.gz |
dns: change behavior for "rc-manager=symlink" to preserve "/etc/resolv.conf" as file
The purpose of "rc-manager=symlink" is so that the administrator can point
the "/etc/resolv.conf" as a symlink to a certain file, and thus indicating
that a certain component is responsible to manage resolv.conf, while others
should stay away from it.
For example, systemd-resolved never touches "/etc/resolv.conf", but
expects the admin to setup the symlink appropriately. It also recognizes
whether the symlink points to it's own resolv.conf in /run or to another
component.
Previously, "rc-manager=symlink" would always replace a regular file
with a symlink to "/var/run/NetworkManager/resolv.conf". Only if
"/etc/resolv.conf" is already a symlink somewhere else, NM would not
touch it. This with the exception that if "/etc/resolv.conf" points to
"/var/run/NetworkManager/resolv.conf", it would replace the symlink
with the same link to raise inotify events.
Change behavior so if "/etc/resolv.conf" is already a regular file, keep
it as file.
This means, if you have multiple components that don't care, everybody
can write the "/etc/resolv.conf" (as file) and there is no clear
expressed responsibility.
It was wrong that NetworkManager would convert the file to a symlink,
this should be reserved to the admin. Instead, NetworkManager should
accept that the intent is unspecified and preserve the regular file.
It's up to the admin to replace the symlink to somewhere else (to keep
NM off), or to point it to "/var/run/NetworkManager/resolv.conf", to show
the explicit intent.
The wrong behavior causes dangling symlinks when somebody disables
NetworkManager for good.
https://bugzilla.redhat.com/show_bug.cgi?id=1367551
Diffstat (limited to 'man')
-rw-r--r-- | man/NetworkManager.conf.xml | 20 | ||||
-rw-r--r-- | man/common.ent.in | 1 |
2 files changed, 12 insertions, 9 deletions
diff --git a/man/NetworkManager.conf.xml b/man/NetworkManager.conf.xml index 8c93ac4c06..7ca496bfb0 100644 --- a/man/NetworkManager.conf.xml +++ b/man/NetworkManager.conf.xml @@ -321,15 +321,17 @@ no-auto-default=* options, and this version of NetworkManager was build with a default of "<literal>&NM_CONFIG_DEFAULT_MAIN_RC_MANAGER;</literal>". Regardless of this setting, NetworkManager will - always write resolv.conf to its runtime state directory.</para> - <para><literal>symlink</literal>: NetworkManager will symlink - <filename>/etc/resolv.conf</filename> to its private - resolv.conf file in the runtime state directory. If - <filename>/etc/resolv.conf</filename> - already is a symlink pointing to a different location, the file - will not be modified. This allows the user to disable managing - by pointing the link <filename>/etc/resolv.conf</filename> to - somewhere else.</para> + always write resolv.conf to its runtime state directory + <filename>&nmrundir;/resolv.conf</filename>.</para> + <para><literal>symlink</literal>: If <filename>/etc/resolv.conf</filename> is + a regular file, NetworkManager will replace the file on update. If + <filename>/etc/resolv.conf</filename> is instead a symlink, NetworkManager + will leave it alone. Unless the symlink points to the internal file + <filename>&nmrundir;/resolv.conf</filename>, + in which case the symlink will be updated to emit an inotify notification. + This allows the user to conveniently instruct NetworkManager not + to manage <filename>/etc/resolv.conf</filename> by replacing it with + a symlink.</para> <para><literal>file</literal>: NetworkManager will write <filename>/etc/resolv.conf</filename> as file. If it finds a symlink, it will follow the symlink and update the target diff --git a/man/common.ent.in b/man/common.ent.in index 4c3310c44b..b3a4bca8fe 100644 --- a/man/common.ent.in +++ b/man/common.ent.in @@ -1,6 +1,7 @@ <?xml version="1.0" encoding="utf-8" ?> <!ENTITY NM_VERSION "@NM_VERSION@"> <!ENTITY sysconfdir "@sysconfdir@"> +<!ENTITY nmrundir "@nmrundir_@"> <!ENTITY NM_CONFIG_DEFAULT_MAIN_AUTH_POLKIT_TEXT "@NM_CONFIG_DEFAULT_MAIN_AUTH_POLKIT_TEXT@"> <!ENTITY NM_CONFIG_DEFAULT_LOGGING_BACKEND_TEXT "@NM_CONFIG_DEFAULT_LOGGING_BACKEND_TEXT@"> <!ENTITY NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT "@NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT@"> |