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

Do a rename to move our resolv.conf into place to wipe out symlinks #552

Merged
merged 1 commit into from Aug 19, 2016

Conversation

cmaloney
Copy link
Contributor

Should resolve https://dcosjira.atlassian.net/browse/DCOS-305

Basically: Systemd by default makes /etc/resolv.conf a symlink to /run/systemd/resolve/resolv.conf which is owned by systemd-resolved / systemd-networkd. Just writing directly to that file, there ends up being some "contested" / racy ownership.

By writing to a temp file next to that, and moving into place we do two things

  1. The symlink gets replaced by a file so there isn't a race anymore
  2. Changing resolv.conf is "atomic" / can't have partial writes and the like show up in the file things use.

cmaloney added a commit to mesosphere/dcos that referenced this pull request Aug 18, 2016
@cmaloney cmaloney mentioned this pull request Aug 18, 2016
@cmaloney cmaloney merged commit 5793ea3 into dcos:master Aug 19, 2016
@orsenthil
Copy link
Contributor

Pass by review comment: resolvconf_path + ".tmp" at line 79 and line 90 could be extracted to a single constant.

@cmaloney cmaloney deleted the resolvconf-rename-for-dcos branch August 26, 2016 22:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants