Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoids permanent break of resolv.conf. #496

Conversation

ivanalejandro0
Copy link
Contributor

The resolv.conf file gets updated by resolvconf, maintaining it as a
symlink allows the system to reset it during boot time. That is useful
when the app has a hard crash that gives no chance to roll back our
changes.

[Closes #4633]

@ivanalejandro0
Copy link
Contributor Author

The only thing that bothers me is that I don't know if resolvconf may update the resolv.conf file after we dump our configurations and we won't notice that.
Along with this we may want to monitor that the resolv.conf contents are what we need.

@ghost ghost assigned kalikaneko and elijh Dec 18, 2013
@elijh
Copy link
Member

elijh commented Dec 18, 2013

so far, resolvconf has not messed with resolv.conf after we obliterate the default one.

this change looks good to me.

@elijh
Copy link
Member

elijh commented Dec 18, 2013

maintaining it as a symlink allows the system to reset it during boot time

i don't see it maintained as a symlink. what does this comment relate to?

@ivanalejandro0
Copy link
Contributor Author

Oops!, my bad.
I was editing the same file in the VM and in the repo and missed one change.
Now instead of moving the symling I just copy it, and then replace its contents.
In this situation resolvconf may update the source (/run/resolvconf/resolv.conf).

According to the documentation (https://help.ubuntu.com/13.04/serverguide/network-configuration.html), sometimes resolvconf gets triggered and updates the resolv.conf file. It does not say explicitly in which situations, but mentions that gets updated when interfaces changes (maybe plugging a wifi dongle may do the trick).

Here we have 2 situations:

  1. Override the resolv.conf symlink (as we currently do)
    pro: resolvconf won't mess with our config
    con: if the app has a hard crash the user no longer can use the network
    con solver: add a script (maybe at boot time) that check if the resolv.conf file is broken and fix it.

  2. Override the resolv.conf contents (this pullreq)
    pro: resolvconf takes care of fixing the resolv.conf file on reboot (in my tests it even fixes it inmediatly when the app crashes)
    con: resolvconf may reset the resolv.conf file contents to its defaults
    con solver: have a dns monitor to avoid something changing our resolv.conf file. An adventage of this is that we can be aware if something else changes our dns configuration and warn the user since is a security issue.

I think that the way to go is 2, since we don't mess with the defaults (resolv.conf symlink)

The resolv.conf file gets updated by resolvconf, maintaining it as a
symlink allows the system to reset it during boot time. That is useful
when the app has a hard crash that gives no chance to roll back our
changes.

[Closes #4633]
@leap-code-o-matic leap-code-o-matic merged commit 2bb4836 into leapcode:develop Dec 20, 2013
@ivanalejandro0 ivanalejandro0 deleted the bug/4633-fix-resolvconf-usage branch December 20, 2013 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants