Hybrid cloud cluster monorepo with Ansible, K8s, NixOS, and Terraform. cute.haus
ansible terraform nix k8s
0

Configure Feed

Select the types of activity you want to include in your feed.

fix(b2-mounts): auto-recover from transient network failures

Three layers of defense:

1. StartLimitIntervalSec=0 — removes systemd's permanent
failure state for rclone mount units so automount retries
indefinitely when network recovers (core fix)

2. systemd timer (every 5 min) — health checks each B2 mount
and resets + restarts any that have gone stale, catching
edge cases the automount retry doesn't cover

3. network-online.target ordering — health service respects
network state before attempting recovery

Aly Raffauf (Jul 9, 2026, 9:29 PM EDT) 2c16a928 b7acce0c

+29
+29
nix/nixos/profiles/b2-mounts.nix
··· 42 42 device = "b2:${remote}"; 43 43 fsType = "rclone"; 44 44 options = b2Options ++ b2ProfileOptions.${profile}; 45 + unitConfig = { 46 + StartLimitIntervalSec = "0"; 47 + }; 45 48 }; 46 49 }; 47 50 ··· 98 101 }) 99 102 cfg.shares)) 100 103 allShares)); 104 + 105 + systemd.services.b2-mount-health = let 106 + healthScript = pkgs.writeShellScript "b2-mount-health" '' 107 + for share in ${toString cfg.shares}; do 108 + if ! mountpoint -q "/mnt/Backblaze/$share"; then 109 + systemctl reset-failed "mnt-Backblaze-$share.mount" "mnt-Backblaze-$share.automount" 110 + systemctl start "mnt-Backblaze-$share.mount" || true 111 + fi 112 + done 113 + ''; 114 + in { 115 + description = "B2 FUSE mount health check — restarts failed mounts"; 116 + after = ["network-online.target"]; 117 + wants = ["network-online.target"]; 118 + serviceConfig.Type = "oneshot"; 119 + serviceConfig.ExecStart = "${healthScript}"; 120 + }; 121 + 122 + systemd.timers.b2-mount-health = { 123 + description = "Periodic B2 mount health check"; 124 + timerConfig = { 125 + OnCalendar = "*:0/5"; 126 + Persistent = true; 127 + }; 128 + wantedBy = ["timers.target"]; 129 + }; 101 130 }; 102 131 }; 103 132 }