Bug 1391770

Summary: resolvd.conf symlink is invalid after reboot
Product: [Fedora] Fedora Reporter: xrunner <miller2013>
Component: NetworkManagerAssignee: Lubomir Rintel <lkundrak>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 24CC: dcbw, fgiudici, lkundrak, miller2013, psimerda, thaller
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-11-11 02:52:41 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description xrunner 2016-11-04 00:43:03 UTC
Description of problem:
After DNF update (Nov 2), resolv.conf symlink is pointing to an non-existent file so most internet functionality is lost.

Version-Release number of selected component (if applicable):
???

How reproducible:
Reboot. Symlink is now:
/etc/resolv.conf/ -> /var/run/connman/resolv.conf
should be:
/etc/resolv.conf -> /var/run/NetworkManager/resolv.conf


Steps to Reproduce:
1. Reboot
2. Check /etc/resolv.conf. It is error.
3. Delete symlink /etc/resolv.conf .
4. vi /etc/resolv.conf
5. Add 2 lines:
    nameserver: 8.8.8.8
    nameserver: 4.4.4.4
  <save>
6. Restart network using icon in the top bar. ("systemctl restart network" fails!)
7. /etc/resolv.conf file replaced with symlink to "/var/run/NetworkManager/resolv.conf"

Actual results:
  Resolver fails.

Expected results:
  Resolver works.

Additional info:

Comment 1 Thomas Haller 2016-11-04 13:23:36 UTC
your description is not clear to me. What is the issue?

First you say:

> How reproducible:
> Reboot. Symlink is now:
> /etc/resolv.conf/ -> /var/run/connman/resolv.conf
> should be:

But your "Steps to Reproduce" don't mention any dnf update or how the symlink is wrong after reboot.



Thank you

Comment 2 xrunner 2016-11-07 23:55:11 UTC
Sorry that I wasn't very clear. I included the dnf update to try and help with the date that the change likely occurred.

Steps to Reproduce:
1. Reboot
2. /etc/resolv.conf points to /var/run/connman/resolv.conf which does not exist.
3. Delete symlink /etc/resolv.conf .
4. Shut off network (wifi) using the wifi menu option in the top bar menu.
4. vi /etc/resolv.conf
5. Add 2 lines:
    nameserver: 8.8.8.8
    nameserver: 4.4.4.4
  <save>
6. Restart wifi using icon in the top bar. (command "systemctl restart network" fails, that's why we need to use the top bar menu)
7. Restarting the network replaces the just-edited /etc/resolv.conf file with symlink to "/var/run/NetworkManager/resolv.conf" and resolver is working again.

Comment 3 Thomas Haller 2016-11-08 07:51:13 UTC
NM (unless configured differently) would manage resolv.conf with mode "symlink" -- see "rc-manager" in `man NetworkManager.conf`. The "symlink" mode would not replace an existing symlink to a different location (like /var/run/connman) on purpose, because it tells NM that somebody else is taking care of resolv.conf.

You say what you did, but not what
  - you think happened wrongly
  - you think instead should have happened.
Do you mean that step 2 is wrong? That is expected behavior, see above.


Regarding point 6:

  - `systemctl restart network` is the legacy initscripts. It is not NetworkManager, and usually you wouldn't use it. Also, usually you would not do a `systemctl restart NetworkManager` either, because you don't restart NetworkManager to apply configuration.

Comment 4 xrunner 2016-11-09 03:44:44 UTC
Thanks for the information on NetworkManager.

What I think happened wrongly: The symlink that keeps getting created on bootup is a broken link (pointing to /var/run/connman/resolv.conf). Resolver doesn't work until I create the resolv.conf file with valid IPs. When NM starts it automatically replaces that file with a symlink to /var/run/NetworkManager/resolv.conf which continues to work until I reboot again. On reboot the symlink is replaced by another symlink which points to /var/run/connman/resolv.conf.

What I think should happen: Whatever process is replacing the valid symlink should not replace it with a broken link.

If step 2 above is correct (and I'm not trying to argue that it's wrong) then why is there no target file and why does something create a different symlink to /var/run/NetworkManager?

Thanks for your continued responses and questions.

Comment 5 Thomas Haller 2016-11-09 07:25:58 UTC
I don't know who creates the broken symlink, certainly not NetworkManager. From the link destination it looks like connman does it.

If you don't intend to run NetworkManager and connman side by side, disable/uninstall one of them.

If you do that intentionally, ensure that they don't fight over who manages resolv.conf. NetworkManager can be configured to various rc-manager modes, including not managing resolv.conf. See `man NetworkManager.conf`.

Comment 6 xrunner 2016-11-11 02:52:41 UTC
I've removed conman and things seem to be working fine now.

Thanks for your help.