mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-11-13 12:13:46 +01:00
fix(monitoring): order smartctl exporter after network-online.target (#372)
The exporter binds to the host LAN address, which systemd-networkd assigns during boot. Without ordering, the service starts before the address exists, `bind: cannot assign requested address` trips the start limit, and the unit stays failed until restarted manually. Order the unit after network-online.target, and since wait-online is best-effort (120s timeout), also retry patiently so the unit self-heals when the link comes up late.
This commit is contained in:
1 parent
3a5b9ec4c6
commit
1b31730db4
1 file changed
+13
@@ -54,4 +54,17 @@
|
||||
port = 9633;
|
||||
maxInterval = "60s";
|
||||
};
|
||||
|
||||
# The exporter binds to the LAN address, which networkd assigns during boot;
|
||||
# without ordering it races the address and trips the start limit (seen on ai).
|
||||
# wait-online is best-effort (120s timeout), so also retry patiently to
|
||||
# self-heal when the link comes up late.
|
||||
systemd.services.prometheus-smartctl-exporter = lib.mkIf config.modules.hardwareTools.enable {
|
||||
after = [ "network-online.target" ];
|
||||
wants = [ "network-online.target" ];
|
||||
serviceConfig = {
|
||||
RestartSec = "10s";
|
||||
StartLimitIntervalSec = 0;
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user