Inject /etc/resolv.conf into VM rootfs to fix DNS failure cycling#11
Merged
Conversation
systemd-networkd clears /etc/resolv.conf when it takes over the interface, and with systemd-resolved masked the DNS entries from eth.network are never written back. The result is an empty resolv.conf inside the VM, causing config.sh to fail immediately when it tries to reach api.github.com, which triggers the ExecStopPost reboot and the 3-second cycling we observed on ci-hel3. Fix: overwrite /etc/resolv.conf from inject_config() right after writing eth.network, so the file is always present regardless of what networkd does during boot. Also add DNS=1.1.1.1 to the eth.network template as a belt-and-suspenders measure. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Hi @guifranchi, We've found some issues with your Pull Request.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
VMs on ci-hel3 were cycling every ~3 seconds. Diagnostic testing confirmed the root cause:
systemd-networkdclears/etc/resolv.confwhen it takes over the interface. Withsystemd-resolvedmasked in the base image, networkd never writes DNS entries back to the file — even whenDNS=is set in the.networkunit. The result is an empty resolv.conf inside every VM.config.shtries to reachapi.github.comon startup, gets a DNS failure, exits non-zero, and theExecStopPost=+/usr/sbin/rebootinrunner.servicetriggers an immediate reboot — producing the 3-second cycle.Fix
/etc/resolv.confininject_config()right after writingeth.network, sonameserver 1.1.1.1is always present regardless of what networkd does during boot.DNS=1.1.1.1to theeth.networktemplate as a belt-and-suspenders measure.Test plan
actions-runner.servicejournalctl -u actions-runner