-
Notifications
You must be signed in to change notification settings - Fork 10
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comments
src/modules/RootPart.rb
Outdated
@@ -1714,6 +1716,16 @@ def create_backup | |||
end | |||
end | |||
|
|||
def pre_inject_files |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
src/modules/RootPart.rb
Outdated
create_backup | ||
inject_intsys_files | ||
end | ||
|
||
success | ||
end | ||
|
||
RESOLV_CONF = "/etc/resolv.conf".freeze | ||
RESOLV_CONF = "/run/netconfig/resolv.conf".freeze |
There was a problem hiding this comment.
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.
src/modules/RootPart.rb
Outdated
@@ -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) |
There was a problem hiding this comment.
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
.
better go for yast/yast-storage-ng#958 |
We finally went for bind-mount /run as @wfeldt mentioned, so, closing this PBI as not needed anymore |
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.