Your message dated Fri, 27 Nov 2026 21:49:38 +0000
with message-id <[email protected]>
and subject line Bug#1155542: fixed in dracut 113-2
has caused the Debian Bug report #1155542,
regarding dracut: 61-chrony autopkgtest fails with chrony-wait.service timeout 
under systemd-networkd
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
1155542: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1155542
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: dracut
Version: 113-1
Severity: important
Tags: patch
Forwarded: https://github.com/dracut-ng/dracut/pull/2845
User: [email protected]
Usertags: origin-ubuntu tenacious ubuntu-patch

Dear Maintainer,

The 61-chrony autopkgtest added in dracut 112-8 / 113-1 fails on Debian 
unstable and Ubuntu tenacious with a chrony-wait.service timeout (upstream 
issue https://github.com/dracut-ng/dracut/issues/2541, Ubuntu bug 
https://bugs.launchpad.net/ubuntu/+source/dracut/+bug/2178220).

Root cause:
On Debian and Ubuntu, dracut-network uses the 11systemd-networkd module by 
default:
1. modules.d/11systemd-networkd/module-setup.sh does not install 
libnss_dns.so.* into the initramfs (unlike 35network-manager and 
35network-legacy).
2. modules.d/11systemd-networkd/networkd-config.sh does not register an 
initqueue/finished hook when rd.neednet=1 is set, so dracut-initqueue exits 
immediately when the root filesystem is local without executing 
initqueue/settled/99-networkd-run.sh.
3. modules.d/11systemd-networkd/networkd-run.sh does not write DHCP DNS servers 
(or kernel command-line nameserver= options) into /etc/resolv.conf, so chronyd 
cannot resolve pool.ntp.org.

The attached patch fixes all three issues in 11systemd-networkd and makes 
debian/tests/61-chrony and debian/tests/50-network pass.
Upstream PR: https://github.com/dracut-ng/dracut/pull/2845
From 3d06cd9764c0a96e5e6c202841fd5729c5c56b45 Mon Sep 17 00:00:00 2001
From: Viktor Pashaiev <[email protected]>
Date: Fri, 27 Nov 2026 13:49:49 +0100
Subject: [PATCH] fix(systemd-networkd): populate /etc/resolv.conf and wait for
 online

On distributions where dracut-network defaults to 11systemd-networkd,
the 61-chrony test times out in chrony-wait.service because:

1. module-setup.sh does not install libnss_dns.so.* into the initramfs.
2. networkd-config.sh does not register an initqueue/finished hook when
   rd.neednet=1 is set, so dracut-initqueue exits immediately when the
   root device is local without running networkd-run.sh.
3. networkd-run.sh does not populate /etc/resolv.conf from DHCP or
   kernel command-line DNS servers, leaving chronyd unable to resolve
   pool.ntp.org.

Install libnss_dns.so.* in 11systemd-networkd, register the
initqueue/finished/networkd.sh hook when rd.neednet=1, and populate
/etc/resolv.conf from kernel command-line nameserver= arguments and
/run/systemd/netif/state DNS options in networkd-run.sh.

Fixes: https://github.com/dracut-ng/dracut/issues/2541
---
 modules.d/11systemd-networkd/module-setup.sh  |   2 +
 .../11systemd-networkd/networkd-config.sh     |   2 +
 modules.d/11systemd-networkd/networkd-run.sh  |  30 ++++
 test/TEST-61-CHRONY/test.sh                   | 142 ++++++++++++++++++
 4 files changed, 176 insertions(+)

diff --git a/modules.d/11systemd-networkd/module-setup.sh b/modules.d/11systemd-networkd/module-setup.sh
index 484ccd3..9f38a06 100755
--- a/modules.d/11systemd-networkd/module-setup.sh
+++ b/modules.d/11systemd-networkd/module-setup.sh
@@ -72,6 +72,8 @@ install() {
     inst_hook cmdline 99 "$moddir"/networkd-config.sh
     inst_hook initqueue/settled 99 "$moddir"/networkd-run.sh
 
+    inst_libdir_file {"tls/$DRACUT_ARCH/",tls/,"$DRACUT_ARCH/",}"libnss_dns.so.*"
+
     # Enable systemd type units
     for i in \
         systemd-networkd.service \
diff --git a/modules.d/11systemd-networkd/networkd-config.sh b/modules.d/11systemd-networkd/networkd-config.sh
index b6f1ae5..bfdb120 100755
--- a/modules.d/11systemd-networkd/networkd-config.sh
+++ b/modules.d/11systemd-networkd/networkd-config.sh
@@ -38,6 +38,8 @@ if [ -n "$netroot" ] || [ -e /tmp/net.ifaces ]; then
 fi
 
 if getargbool 0 rd.neednet; then
+    # shellcheck disable=SC2016
+    echo 'for i in /tmp/networkd.*.done; do [ -f "$i" ] && exit 0; done; exit 1' > "$hookdir"/initqueue/finished/networkd.sh
     mkdir -p /run/networkd/initrd
     : > /run/networkd/initrd/neednet
 fi
diff --git a/modules.d/11systemd-networkd/networkd-run.sh b/modules.d/11systemd-networkd/networkd-run.sh
index 791b091..0a56838 100755
--- a/modules.d/11systemd-networkd/networkd-run.sh
+++ b/modules.d/11systemd-networkd/networkd-run.sh
@@ -74,6 +74,36 @@ for ifpath in /sys/class/net/*; do
             fi
         fi
 
+        if [ ! -L /etc/resolv.conf ] && [ ! -s /etc/resolv.conf ]; then
+            dns_servers=""
+            if [ -r /run/systemd/netif/state ]; then
+                dns_servers=$(sed -n "s/^DNS=//p" /run/systemd/netif/state)
+            fi
+            nl="
+"
+            resolv=""
+            set -f
+            for s in $(getargs nameserver) $dns_servers; do
+                s=${s%%#*}
+                case "$s" in
+                    \[*\]*)
+                        s=${s#\[}
+                        s=${s%%\]*}
+                        ;;
+                    *.*.*.*:*)
+                        s=${s%:*}
+                        ;;
+                esac
+                [ -n "$s" ] || continue
+                case "${nl}${resolv}" in
+                    *"${nl}nameserver ${s}${nl}"*) ;;
+                    *) resolv="${resolv}nameserver ${s}${nl}" ;;
+                esac
+            done
+            set +f
+            [ -n "$resolv" ] && printf '%s' "$resolv" > /etc/resolv.conf
+        fi
+
         source_hook initqueue/online "$ifname"
         /sbin/netroot "$ifname"
 
diff --git a/test/TEST-61-CHRONY/test.sh b/test/TEST-61-CHRONY/test.sh
index 4fc53ac..de3e1b2 100755
--- a/test/TEST-61-CHRONY/test.sh
+++ b/test/TEST-61-CHRONY/test.sh
@@ -18,6 +18,134 @@ test_check() {
     require_binaries_for_test chronyd openssl python3 systemctl
 }
 
+test_networkd_unit() {
+    local work rc1=0 rc2=0
+    work=$(mktemp -d "$TESTDIR/networkd-unit.XXXXXX")
+
+    # 1. Verify networkd-config.sh rd.neednet=0 (negative) vs rd.neednet=1 (positive) finished hook
+    (
+        set +u
+        netroot=""
+        hookdir="$work/hooks"
+        mkdir -p "$hookdir/initqueue/finished" "$work/run/systemd/network" "$work/etc/cmdline.d" "$work/run/networkd/initrd"
+        sed -e "s|/tmp/|$work/tmp/|g" \
+            -e "s|/run/systemd/network|$work/run/systemd/network|g" \
+            -e "s|/etc/cmdline.d|$work/etc/cmdline.d|g" \
+            -e "s|/run/networkd/initrd|$work/run/networkd/initrd|g" \
+            -e "s|/usr/lib/dracut/default.network|$PKGLIBDIR/modules.d/11systemd-networkd/dracut-default.network|g" \
+            "$PKGLIBDIR/modules.d/11systemd-networkd/networkd-config.sh" > "$work/networkd-config-test.sh"
+
+        # shellcheck disable=SC2317,SC2329
+        getcmdline() { echo "$FAKE_CMDLINE"; }
+        # shellcheck disable=SC2317,SC2329
+        systemctl() { :; }
+        # shellcheck disable=SC2317,SC2329
+        getargbool() {
+            case "$FAKE_CMDLINE" in
+                *rd.neednet=1*) return 0 ;;
+                *) return 1 ;;
+            esac
+        }
+
+        # Negative case: rd.neednet=0 must not create initqueue/finished/networkd.sh
+        FAKE_CMDLINE="rd.neednet=0"
+        # shellcheck disable=SC1091
+        . "$work/networkd-config-test.sh"
+        [ ! -e "$hookdir/initqueue/finished/networkd.sh" ] || exit 1
+
+        # Positive case: rd.neednet=1 creates networkd.sh and exits 1 before .done, 0 after .done
+        FAKE_CMDLINE="rd.neednet=1"
+        # shellcheck disable=SC1091
+        . "$work/networkd-config-test.sh"
+        [ -s "$hookdir/initqueue/finished/networkd.sh" ] || exit 1
+        if sh "$hookdir/initqueue/finished/networkd.sh"; then
+            exit 1
+        fi
+        mkdir -p "$work/tmp"
+        : > "$work/tmp/networkd.eth0.done"
+        sh "$hookdir/initqueue/finished/networkd.sh" || exit 1
+    ) || rc1=$?
+
+    # 2. Verify networkd-run.sh /etc/resolv.conf generation from /run/systemd/netif/state and nameserver=
+    (
+        set +u
+        mkdir -p "$work/sys/class/net/eth0" "$work/run/systemd/netif/leases" "$work/tmp" "$work/etc"
+        echo 2 > "$work/sys/class/net/eth0/ifindex"
+
+        sed -e "s|/tmp/|$work/tmp/|g" \
+            -e "s|/sys/class/net|$work/sys/class/net|g" \
+            -e "s|/run/systemd/netif|$work/run/systemd/netif|g" \
+            -e "s|/etc/resolv.conf|$work/etc/resolv.conf|g" \
+            -e "s|/usr/lib/systemd/systemd-networkd-wait-online|true|g" \
+            -e "s|/sbin/netroot|true|g" \
+            "$PKGLIBDIR/modules.d/11systemd-networkd/networkd-run.sh" > "$work/networkd-run-test.sh"
+
+        # shellcheck disable=SC2317,SC2329
+        source_hook() { :; }
+        # shellcheck disable=SC2317,SC2329
+        escape() { printf "%s" "$1"; }
+        # shellcheck disable=SC2317,SC2329
+        trim() { printf "%s" "$1" | sed "s/^[[:space:]]*//;s/[[:space:]]*$//"; }
+        # shellcheck disable=SC2317,SC2329
+        getargs() { printf "%s\n" "${FAKE_NAMESERVERS-}"; }
+        # shellcheck disable=SC2317,SC2329
+        networkctl() { return 1; }
+
+        # Case A (negative): no state file and no cmdline nameserver -> /etc/resolv.conf not created
+        rm -f "$work/tmp/networkd.eth0.done"
+        FAKE_NAMESERVERS=""
+        # shellcheck disable=SC1091
+        . "$work/networkd-run-test.sh"
+        [ ! -e "$work/etc/resolv.conf" ] || exit 1
+        [ -f "$work/tmp/networkd.eth0.done" ] || exit 1
+
+        # Case A2: no state file, cmdline nameserver only -> written from cmdline
+        rm -f "$work/tmp/networkd.eth0.done" "$work/etc/resolv.conf"
+        FAKE_NAMESERVERS="192.0.2.53 [2001:db8::53]:53"
+        # shellcheck disable=SC1091
+        . "$work/networkd-run-test.sh"
+        [ "$(cat "$work/etc/resolv.conf")" = "$(printf "%s\n" "nameserver 192.0.2.53" "nameserver 2001:db8::53")" ] || exit 1
+        rm -f "$work/etc/resolv.conf"
+
+        # Case B: state file DNS= (with :port#sni, %scope, [ipv6]:port) + cmdline nameserver= deduplication
+        rm -f "$work/tmp/networkd.eth0.done"
+        printf "DNS=10.0.2.3:53#dns.example 10.0.2.30:5353 [2606:4700:4700::1111]:53#one.one fe80::1%%2\n" > "$work/run/systemd/netif/state"
+        FAKE_NAMESERVERS="10.0.2.30 10.0.2.3"
+        # shellcheck disable=SC1091
+        . "$work/networkd-run-test.sh"
+        expected_b=$(printf "%s\n" "nameserver 10.0.2.30" "nameserver 10.0.2.3" "nameserver 2606:4700:4700::1111" "nameserver fe80::1%2")
+        [ "$(cat "$work/etc/resolv.conf")" = "$expected_b" ] || exit 1
+
+        # Case B2: existing empty /etc/resolv.conf is overwritten (! -s vs ! -e)
+        rm -f "$work/tmp/networkd.eth0.done"
+        : > "$work/etc/resolv.conf"
+        printf "DNS=10.0.2.3\n" > "$work/run/systemd/netif/state"
+        FAKE_NAMESERVERS=""
+        # shellcheck disable=SC1091
+        . "$work/networkd-run-test.sh"
+        [ "$(cat "$work/etc/resolv.conf")" = "nameserver 10.0.2.3" ] || exit 1
+
+        # Case C (negative): existing non-empty /etc/resolv.conf is preserved
+        rm -f "$work/tmp/networkd.eth0.done"
+        printf "DNS=9.9.9.9\n" > "$work/run/systemd/netif/state"
+        FAKE_NAMESERVERS="8.8.8.8"
+        # shellcheck disable=SC1091
+        . "$work/networkd-run-test.sh"
+        [ "$(cat "$work/etc/resolv.conf")" = "nameserver 10.0.2.3" ] || exit 1
+
+        # Case D (negative): symlinked /etc/resolv.conf is not overwritten
+        rm -f "$work/etc/resolv.conf" "$work/tmp/networkd.eth0.done"
+        ln -s "$work/etc/stub-resolv.conf" "$work/etc/resolv.conf"
+        # shellcheck disable=SC1091
+        . "$work/networkd-run-test.sh"
+        [ -L "$work/etc/resolv.conf" ] || exit 1
+        [ ! -e "$work/etc/stub-resolv.conf" ] || exit 1
+    ) || rc2=$?
+
+    rm -rf "$work"
+    [ "$rc1" -eq 0 ] && [ "$rc2" -eq 0 ]
+}
+
 client_run() {
     local nook="$1"
     local test_name="$2"
@@ -51,6 +179,10 @@ client_run() {
 test_run() {
     declare -a disk_args=()
 
+    if [[ -d "$PKGLIBDIR/modules.d/11systemd-networkd" ]]; then
+        test_networkd_unit || return 1
+    fi
+
     qemu_add_drive disk_args "$TESTDIR"/marker.img marker
     qemu_add_drive disk_args "$TESTDIR"/root.img root
 
@@ -109,6 +241,12 @@ test_setup() {
         echo "#!/bin/sh"
         echo "command -v warn > /dev/null || . /lib/dracut-lib.sh"
         echo 'warn "$(systemctl status chronyd.service)"'
+        echo 'if [ -f /usr/lib/systemd/systemd-networkd ]; then'
+        echo '    if ! grep -qx "nameserver 10.0.2.3" /etc/resolv.conf; then'
+        echo '        warn "Missing DHCP nameserver 10.0.2.3 in /etc/resolv.conf"'
+        echo '        umount /sysroot'
+        echo '    fi'
+        echo 'fi'
         echo "remote_file_content=\$(curl --cacert /etc/$SSL_CERT \"https://10.0.2.2:4443/remote-file.txt\";)"
         echo 'if [ "$remote_file_content" = "dracut-chrony-success" ]; then'
         echo '    warn "$remote_file_content"'
@@ -138,6 +276,10 @@ test_setup() {
         -i "$TESTDIR/fetch-remote-file.sh" "/var/lib/dracut/hooks/pre-pivot/10-fetch-remote-file.sh" \
         -i "$TESTDIR/chrony-less-timeout.conf" "/usr/lib/systemd/system/chrony-wait.service.d/chrony-less-timeout.conf" \
         -a "chrony url-lib ${USE_NETWORK}"
+
+    if lsinitrd "$TESTDIR/initramfs.testing" | grep -q "usr/lib/systemd/systemd-networkd$"; then
+        lsinitrd "$TESTDIR/initramfs.testing" | grep -q "libnss_dns\.so\." || return 1
+    fi
 }
 
 test_cleanup() {
-- 
2.43.0


--- End Message ---
--- Begin Message ---
Source: dracut
Source-Version: 113-2
Done: Benjamin Drung <[email protected]>

We believe that the bug you reported is fixed in the latest version of
dracut, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Benjamin Drung <[email protected]> (supplier of updated dracut package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Fri, 27 Nov 2026 21:57:00 +0100
Source: dracut
Built-For-Profiles: derivative.ubuntu noudeb
Architecture: source
Version: 113-2
Distribution: unstable
Urgency: medium
Maintainer: Debian Kernel Team <[email protected]>
Changed-By: Benjamin Drung <[email protected]>
Closes: 1155542
Launchpad-Bugs-Fixed: 2178220
Changes:
 dracut (113-2) unstable; urgency=medium
 .
   * fix(systemd-networkd): populate resolv.conf via initrd-resolvconf.path
     (Closes: #1155542, LP: #2178220)
   * fix(systemd-networkd): order wait-online before nss-lookup.target
Checksums-Sha1:
 743894f5f2166bbb10b9c8010b124bf874836e15 3311 dracut_113-2.dsc
 40c5443f0b7664c23ca0248ca645c09ac12525a8 35708 dracut_113-2.debian.tar.xz
 3dc69812d87c57b2638ac2bafba36f0f8613dff3 9188 dracut_113-2_source.buildinfo
Checksums-Sha256:
 c9ac0071573a7295695ace3fe5b775a85d709961b366ca109d322bc6eec3c35e 3311 
dracut_113-2.dsc
 d7b44e022a7af45f7634b9eed39b368979622e73f1e5bf206407dffd45015fe7 35708 
dracut_113-2.debian.tar.xz
 80a5f534e335c2ead6c1ac498c7ece1a3ab78338f963c4668d37e457ba494309 9188 
dracut_113-2_source.buildinfo
Files:
 ebfe82e798829b4a7927a2784a22e8d2 3311 utils optional dracut_113-2.dsc
 0057da5a0dfe23bbc94ad5f298521e83 35708 utils optional 
dracut_113-2.debian.tar.xz
 2e9d4f358f86c0869fdd1d5c80ea7962 9188 utils optional 
dracut_113-2_source.buildinfo

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEpi0s+9ULm1vzYNVLFZ61xO/Id0wFAmsJ9r0ACgkQFZ61xO/I
d0xORw//cr2JErcyn/mpbqlhyIBgRsUAIwERHk1lWTVF9cIGCUVIQutZmDxCJl78
TKSNB4N6VX18OuvI84+UVAdzErhEKaYt8rbYCEl7XbBnvBodWla33M9vn3n4zoJ3
rm8IKIdMKxUFg0s1vnx41wKpD3MaowQ8RhqAQOS8YYc57dbSyUeDoccMG1y6emJ9
97J+Q52teP1mNoDYqMnSsusUSil32sezKGpNlu6mHY7Grq+G59OI/v7Uu8f+o9J0
44C9x0BadzT6SildrmKYzT6fHjQg/ff/bEfxY2lNCcfCWcBe+hl9tewmE5kpDACJ
UxO1v1iCQCpDcgvPBTBEVsepiRHl76UR+rHF1+dqdz9rHqgy1fBi6Tmn4VCMqmaW
pwDy6GrAcWqfx/NLagWJAsnEoRDSH1mq22D0BTi+MDufpPtePAvnGW4v/oEmQ65L
XMI5MFqJyLEvF9Xq7lGaRzfZ2+YBKBhwL6D/8XcbCVT4NbmgSmuX80FP9ANNpxYl
f81xtn+hlkJgkiNblZQviCIzh+YP/UtMsW/skxPg2/EyqWG6XATmFYf/n7JbmFD6
ThY+h3RAbF8EKIGfRcRoheq96Q4rL9dww+lMz1AZHRUudqujV2zmi1fSn+pWq4un
F8bKz4t9DbQXBJ96lhWzPdk0iJoidkZimq12C4WzSArOg16CABk=
=2qlY
-----END PGP SIGNATURE-----

Attachment: pgpSz_kapJHvU.pgp
Description: PGP signature


--- End Message ---

Reply via email to