From 625938922cbea948b2c0c07a7a8cd71897924f7b Mon Sep 17 00:00:00 2001 From: Erik Simon Date: Sat, 19 Sep 2026 02:25:14 +0200 Subject: [PATCH] fix(mars): wait for jupiter over the tailnet before mounting its share jupiter resolves to its tailnet IP, but network-online.target fires on the LAN link before tailscaled routes tailscale0. Hermes' RequiresMountsFor pulls the mount at boot, so it failed with ENETUNREACH and took prepare-dirs, the Mnemosyne link and the container down with it, with nothing retrying. The mount now requires a oneshot that polls jupiter:445 for up to 5 minutes. Co-Authored-By: Claude Opus 5 --- hosts/mars/configuration.nix | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/hosts/mars/configuration.nix b/hosts/mars/configuration.nix index 4a69aff..4d3e5d9 100644 --- a/hosts/mars/configuration.nix +++ b/hosts/mars/configuration.nix @@ -47,8 +47,30 @@ # the container with it — confirmed the hard way (~60-70s per start). "x-systemd.mount-timeout=10s" "_netdev" + # Hermes' RequiresMountsFor mounts this at boot, not lazily, and nothing + # retries a failed mount. + "x-systemd.requires=jupiter-reachable.service" ]; }; + # jupiter resolves to its tailnet IP, and network-online.target fires on the + # LAN link before tailscaled has routed tailscale0. 5min covers jupiter + # cold-booting alongside mars. + systemd.services.jupiter-reachable = { + description = "Wait for jupiter's samba over the tailnet"; + after = [ "network-online.target" "tailscaled.service" ]; + wants = [ "network-online.target" ]; + serviceConfig = { + Type = "oneshot"; + RemainAfterExit = true; + TimeoutStartSec = 300; + }; + script = '' + until timeout 2 ${pkgs.bash}/bin/bash -c 'exec 3<>/dev/tcp/jupiter/445' 2>/dev/null; do + sleep 2 + done + ''; + }; + system.stateVersion = "26.05"; # set at install time; do NOT bump on upgrades }