Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-19236

NetworkManager fails to update /etc/resolv.conf when readonly-root is enabled

    • None
    • Moderate
    • rhel-sst-network-management
    • ssg_networking
    • 3
    • False
    • Hide

      None

      Show
      None
    • No
    • Red Hat Enterprise Linux
    • None
    • Hide

      Givena system administrator running a system with NetworkManager and the system is configured with readonly-root enabled, making /etc/ a read-only file system, and the network interface is set to DHCP,
      When the system boots up or when there is a change in network state that requires an update to DNS settings,
      Then NetworkManager should create a symlink between /etc/resolv.conf and /var/run/NetworkManager/resolv.conf

      Defintion of Done:

      • The implementation meets the acceptance criteria
      • Unit test and integration test are written and pass
      • The code is part of a downstream build attached to an errata
      Show
      Givena system administrator running a system with NetworkManager and the system is configured with readonly-root enabled, making /etc/ a read-only file system, and the network interface is set to DHCP, When the system boots up or when there is a change in network state that requires an update to DNS settings, Then NetworkManager should create a symlink between /etc/resolv.conf and /var/run/NetworkManager/resolv.conf Defintion of Done: The implementation meets the acceptance criteria Unit test and integration test are written and pass The code is part of a downstream build attached to an errata
    • None
    • None
    • Release Note Not Required
    • All
    • None

      What were you trying to do that didn't work?

      A customer implemented readonly-root through following the documentation.
      Such configuration leads to not letting NetworkManager update /etc/resolv.conf when the network interface is in DHCP, because NetworkManager creates a temporary file /etc/resolv.conf.XXX, then renames it.
      With readonly-root, /etc/resolv.conf is writable (because it's on tmpfs automatically) but since NetworkManager creates a temporary file first, this doesn't work.

      See error in the journal:

      [...] NetworkManager[765]: <warn>  [1702384116.2012] dns-mgr: could not commit DNS changes: Failed to create file “/etc/resolv.conf.TFEYF2”: Read-only file system
      

      Please work with readonly-root maintainers to find a solution.

      Please provide the package NVR for which bug is seen:

      NetworkManager-1.40.16-9.el8.x86_64

      How reproducible:

      Always.

      Steps to reproduce

      1. Install a system then enable readonly-root
      2. Keep the network interface in DHCP
      3. Reboot

      Expected results

      /etc/resolv.conf updated, no warning.

      Actual results

      /etc/resolv.conf not updated.

              rh-ee-sfaye Stanislas Faye
              rhn-support-rmetrich Renaud Métrich
              Renaud Métrich
              Network Management Team Network Management Team
              Vladimir Benes Vladimir Benes
              Votes:
              0 Vote for this issue
              Watchers:
              11 Start watching this issue

                Created:
                Updated:
                Resolved: