View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0009865 | Kali Linux | Kali Package Bug | public | 2026-09-19 00:58 | 2026-09-19 02:29 |
| Reporter | Lynx | Assigned To | |||
| Priority | normal | Severity | minor | Reproducibility | have not tried |
| Status | new | Resolution | open | ||
| Summary | 0009865: systemd-resolved resolve hook (io.systemd.Network) times out for 0000063:0000090-400s during cloud-init init-local on AWS EC2, delaying ever | ||||
| Description | Environment
Affected Package
SummaryOn every reboot / stop-start, Query on hook '/run/systemd/resolve.hook/io.systemd.Network' failed with each timing out after ~30s, which dominates the init-local stage duration. Steps to Reproduce
Reproduction note (important)This bug only manifests on boots where cloud-init detects the primary NIC in the init-local stage, i.e. the log shows: DataSourceEc2.py[DEBUG]: Looking for the primary NIC in: ['eth0'] Only such boots trigger the name resolution that hits the resolve hook and stalls. Boots that log an EMPTY NIC list: DataSourceEc2.py[DEBUG]: Looking for the primary NIC in: [] skip init-local's resolution path entirely and finish in ~0.1s — these do NOT reproduce the problem and must not be used to conclude the bug is absent. Whether a given boot takes the ['eth0'] path depends on cloud-init's instance cache state; a stop/start (or certain reboots) reliably triggers the ['eth0'] slow path. When verifying a fix, confirm the boot actually took the ['eth0'] path (grep the cloud-init log) before judging the result. Expected
ActualOn boots where cloud-init detects the primary NIC (
found local data from DataSourceEc2Local @00.015s +131.261s Ruled out (not the cause)
Workaround (verified)Masking the resolve-hook socket eliminates the timeouts; resolved falls back to DHCP-provided global DNS and name resolution keeps working: sudo systemctl mask systemd-networkd-resolve-hook.socket Results on a fresh instance, worst-case slow path ( init-local: ~152s -> ~16s RecommendationThe resolve-hook query issued by systemd-resolved during early boot should not block for the full timeout when systemd-networkd is not yet running.
This appears to be an ordering/timeout interaction introduced with the systemd 259 resolve-hook mechanism as integrated in the Kali cloud image. Appendix.Evidence 1 — cloud-init timing of the slow boot
Evidence 2 — systemd-resolved resolve-hook timeouts (30s interval × 4)
Evidence 3 — resolve-hook socket unit (socket activation)
Versions | ||||
Follow-up commentAdditional investigation: a separate problem exists on systemd 261 / cloud-init 26.2After the original report (systemd 259.1, resolved io.systemd.Network hook timeout), I continued testing on instances that had been updated to a newer package set. On those, the systemctl mask systemd-networkd-resolve-hook.socket workaround removes the hook timeouts but does NOT fix the boot delay — because a different root cause dominates there. Environment (where the new problem appears)
SymptomWith the resolve-hook socket already masked (confirmed: io.systemd.Network TimedOut count = 0 for the boot), cloud-init-local.service still hangs ~300s on boots that take the primary-NIC path. Root cause (confirmed by logs)cloud-init 26.2 brings up its ephemeral network in the init-local stage by running dhcpcd and waiting for the process to exit with a 300s timeout (
With dhcpcd 10.5.2, on a cold start the client acquires the lease and configures the IP successfully, then forks to background, but the parent invocation never returns, so cloud-init hits the full 300s timeout and then declares the ephemeral setup failed — even though the interface was actually configured. Evidence (fresh boot, hook already masked, ['eth0'] slow path)
Note the dhcpcd stderr clearly shows the lease was obtained and the address/route were added; the only problem is the parent process not returning, which cloud-init interprets as a timeout/failure. Same boot, confirming the hook issue is NOT the cause here:
Isolation (single-variable test)
The cloud-init source comment itself references known dhcpcd non-daemon lease-parsing issues (NetworkConfiguration/dhcpcd 0000285–0000287) and deliberately allows dhcpcd to daemonize via --persistent; with dhcpcd 10.5.2 the parent no longer returns promptly under --waitip, which appears to be the regression. RecommendationThis is a distinct issue from the original resolved hook timeout. It looks like a cloud-init 26.2 + dhcpcd 10.5.2 interaction:
Reproducible on freshly-launched instances with no user customization other than masking the resolve-hook socket. |
|