Skip to content

archup-first-boot: DNS not ready when service runs, causing all network operations to fail #3

@bnema

Description

@bnema

Description

The archup-first-boot.service fails silently on first boot because DNS is not yet available when the service starts, despite the service declaring After=network-online.target.

Observed behavior

All network-dependent steps fail with Could not resolve host: ...:

  • archup-cli install: dial tcp: lookup proxy.golang.org ... connection refused
  • ble.sh install: Could not resolve host: github.com
  • pacman -Syu in cli-tools.sh: every mirror returns Could not resolve host: ...

The journal only shows [KO] CLI tools installation failed (non-critical), hiding the real cause.

Root cause

network-online.target signals that a network interface has an IP address, but does not guarantee that DNS is operational. The DNS resolver (systemd-resolved or otherwise) may not be fully ready by the time the service runs, especially on first boot.

Steps to reproduce

Fresh install → first boot → check /var/log/archup-first-boot.log → all curl/pacman/go calls fail with DNS resolution errors.

Proposed fixes

Option 1 — Add systemd-resolved as a dependency in the service unit:

After=local-fs.target systemd-logind.service dbus.service network-online.target systemd-resolved.service
Wants=network-online.target systemd-resolved.service

Option 2 — Add a DNS readiness wait loop at the top of all.sh before any network calls:

echo "Waiting for DNS..." | tee -a "$LOG_FILE"
until nslookup archlinux.org &>/dev/null; do sleep 2; done
echo "DNS is ready." | tee -a "$LOG_FILE"

Option 3 — Combine both for maximum robustness.

Workaround

Remove the sentinel file and re-run the service once the system is fully up:

sudo rm /var/lib/archup-first-boot-complete
sudo systemctl start archup-first-boot.service

Environment

  • Service: /etc/systemd/system/archup-first-boot.service
  • Scripts: /usr/local/share/archup/post-boot/
  • Log: /var/log/archup-first-boot.log

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions