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

Add timer to remount /etc/resolv.conf if it has changed #42

Open
lucas-stauder opened this issue Sep 6, 2024 · 0 comments
Open

Add timer to remount /etc/resolv.conf if it has changed #42

lucas-stauder opened this issue Sep 6, 2024 · 0 comments
Labels
bug Something isn't working triage

Comments

@lucas-stauder
Copy link

lucas-stauder commented Sep 6, 2024

Issue Description

Distrobox is not updating host files for containers which have an init system.

Steps to Reproduce

  • Switch Networks so the content on of resolv.conf on the host changes
  • check in vso-pico, didn't update

On what version of Vanilla OS this happens?

Unreleased

Additional Information

Add sysdtimer to run the following script every 15s or so

#!/bin/bash

# Path to the original and target files
SOURCE_FILE="/run/host/etc/resolv.conf"
TARGET_FILE="/etc/resolv.conf"

# Check if the files are different
if ! diff "${SOURCE_FILE}" "${TARGET_FILE}" > /dev/null; then
        echo "remounting..."
        # Unmount the target file if mounted
        umount "$TARGET_FILE"
        # Bind mount the source file to the target location
        mount --bind "$SOURCE_FILE" "$TARGET_FILE"
else
        echo "everything fine"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage
Projects
None yet
Development

No branches or pull requests

1 participant