From 5adea3ece74ef187384f14995bd2c1cc68f0b2ee Mon Sep 17 00:00:00 2001 From: Ziad Arafat Date: Mon, 9 Nov 2026 09:08:59 -0700 Subject: [PATCH] netbird unit: create /run/netbird and /var/lib/netbird; dot system restarts it The daemon creates neither its socket dir nor its state dir, so the unit failed with 'listen unix /var/run/netbird/sock: bind: no such file or directory' and restart-looped (8.6k restarts on the Deck). RuntimeDirectory= and StateDirectory= create both. dot system now restarts the service so a changed unit or binary takes effect, and prints the first-time 'netbird up --management-url' hint for the self-hosted server. Co-Authored-By: Claude Opus 5.5 --- bin/dot | 5 +++-- config/netbird/netbird.service | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/bin/dot b/bin/dot index a483820..f7acadc 100755 --- a/bin/dot +++ b/bin/dot @@ -139,8 +139,9 @@ netbird_service() { has_systemd || { warn "no systemd; skipping netbird service"; return; } sed "s|@NETBIRD@|$bin|" "$DOTFILES_DIR/config/netbird/netbird.service" | SUDO tee /etc/systemd/system/netbird.service >/dev/null SUDO systemctl daemon-reload - SUDO systemctl enable --now netbird.service - ok "netbird daemon running ($bin)" + SUDO systemctl enable netbird.service + SUDO systemctl restart netbird.service # picks up a changed unit or a new binary after `dot switch` + ok "netbird daemon running ($bin); first time: netbird up --management-url https://netbird.godemperordoge.org" } defguard_service() { diff --git a/config/netbird/netbird.service b/config/netbird/netbird.service index 95b75f6..665742a 100644 --- a/config/netbird/netbird.service +++ b/config/netbird/netbird.service @@ -6,6 +6,10 @@ After=network-online.target Wants=network-online.target [Service] +# The daemon neither creates its socket dir (/run/netbird) nor its state dir (/var/lib/netbird): without these +# it dies with "listen unix /var/run/netbird/sock: bind: no such file or directory" and restart-loops forever. +RuntimeDirectory=netbird +StateDirectory=netbird ExecStart=@NETBIRD@ service run --config /var/lib/netbird/config.json --log-file console Restart=on-failure RestartSec=5