-
Notifications
You must be signed in to change notification settings - Fork 76
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
Add dns config #1875
Add dns config #1875
Conversation
96896c7
to
3d122f7
Compare
This is a workaround to make the container's `resolv.conf` synchronized with the host's `resolv.conf`. To do that, we disallow docker from managing the container's DNS nameservers by unmounting the container's `/etc/resolv.conf`, and soft linking it to the binded host's `/etc/resolv.conf`. So for this to work, the container's `/etc/resolv.conf.host` file should be binded (read-only) to the host's `/etc/resolv.conf`, for our system, it's configured in `bootstrap/startup.json.default`, and a patch is added in `core/tools/blueos_startup_update` so systems with older bootstrap versions can also work with it. One detail is that because docker uses `mount` to bind the host's file to the container's file, if the file-descriptor of the file changes, the bind will be lost. To prevent this, the file being binded must be a hard link to the actual `/etc/resolv.conf`, and that hard link file is the one being binded. This hard link is being done in `core/tools/blueos_startup_update` as `/etc/resolv.conf.host`. To briefly understand why it is necessary, when the docker starts a container, it generates the container `/etc/resolv.conf` based on the host's one, or some docker configuration, however, during the container's lifetime, if the host's DNS configuration changes, the container's DNS doesn't follow it, making the container (possibly) unable to resolve DNSs correctly, failing the BlueOS Helper's internet connection check. By syncing the container's resolv.conf with the host's one, we make sure the container's DNS configuration follows the host's changes, thus, ensuring the container is able to resolve DNSs correctly.
… tabbed container with both Interface Priority and Dns Configuraiton
…ly button when loading
3d122f7
to
a0f4216
Compare
def file_exists(file_name: str) -> bool: | ||
command = f'sudo test -e "{file_name}"' | ||
output = run_command(command, True) | ||
print(output) |
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.
is these prints for debug ?
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.
yes, they allow us to inspect what happened on the Linux side
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.
Closes #1871
Demonstration:
dns_menu_demonstration.mp4