Skip to content

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

@lucas-stauder

Description

@lucas-stauder

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions