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

[RFC] Move the target /etc/resolv.conf to /run #114

Closed
wants to merge 2 commits into from

Conversation

teclator
Copy link
Contributor

The aim of this PR is to start a discussion about possible implementations and maybe summarize the corner cases or scenarios that we could face.

Copy link
Member

@lslezak lslezak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comments

@@ -1714,6 +1716,16 @@ def create_backup
end
end

def pre_inject_files
Copy link
Member

@lslezak lslezak Oct 26, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Term "inject" means adding from outside. In this case we are just moving the files inside /mnt. E.g. the inject_intsys_files method really copies from inst-sys (/) into /mnt. So I'd prefer a different method name here for consistency.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It are a set of checks of steps needed before injecting the resolv conf, so for me looked reasonable, but as it is resolv.conf specific I will try to use something more meaningful.

create_backup
inject_intsys_files
end

success
end

RESOLV_CONF = "/etc/resolv.conf".freeze
RESOLV_CONF = "/run/netconfig/resolv.conf".freeze
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, writing to /run might make troubles. In Leap 15.0 the /run is on a tmpfs file system (RAM disk), but there is no /etc/fstab entry for it so during upgrade /mnt/run is actually on the disk.

There is some extra cleanup done in the end (yast/yast-installation#725), but I think this should be mentioned in a comment as this behavior is not obvious from the code.

@@ -1723,7 +1735,9 @@ def inject_intsys_files
# resolver like systemd-resolver and some configuration of network manager. So we not modify
# symlink target and instead just replace symlink with our file that can resolve and from
# backup we later restore original symlink.
::FileUtils.copy_entry(RESOLV_CONF, target, false, false, true) if File.exist?(RESOLV_CONF)
if File.symlink?(old_target)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: old_target variable does not exist here. Probably a reference to target.

@wfeldt
Copy link
Member

wfeldt commented Aug 29, 2019

better go for yast/yast-storage-ng#958

@teclator
Copy link
Contributor Author

We finally went for bind-mount /run as @wfeldt mentioned, so, closing this PBI as not needed anymore

@teclator teclator closed this Nov 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants