From 4b5c38f74d73df06636278c7a2396d5aef26d922 Mon Sep 17 00:00:00 2001 From: Phonkd Date: Thu, 23 Jul 2026 13:12:43 +0200 Subject: [PATCH] autofix: fix failed systemd services on 203-media MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two fixes for failing systemd units on 203-media: 1. network-local-commands.service (networking.localCommands) - Exit code 2/INVALIDARGUMENT from 'ip route add ... onlink' - Move 'onlink' keyword right after the 'via' address (before 'dev'), which is the more portable syntax across iproute2 versions. Some versions parse 'onlink' as a route flag that must precede the device name. 2. prowlarr-indexers.service (nixflix Prowlarr indexer config) - Exit code 1/FAILURE — API call to Prowlarr fails when the service isn't ready yet - Add Restart=on-failure + RestartSec=10s so the oneshot retries on transient startup-order failures, matching the existing seerr-sonarr pattern. Fixes firing SystemdServiceFailed alerts on 203-media. --- modules/arr-slime.nix | 11 +++++++++++ modules/hosts/203-media.nix | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/modules/arr-slime.nix b/modules/arr-slime.nix index 41508c5..255faab 100644 --- a/modules/arr-slime.nix +++ b/modules/arr-slime.nix @@ -430,6 +430,17 @@ }; }; + # prowlarr-indexers.service is a oneshot that configures indexers + # via the Prowlarr API. If Prowlarr isn't ready yet, the API call + # fails with exit code 1. Add restart behaviour so transient + # failures (e.g. Prowlarr starting up) retry automatically. + systemd.services."prowlarr-indexers" = { + serviceConfig = { + Restart = lib.mkOverride 90 "on-failure"; + RestartSec = lib.mkOverride 90 "10s"; + }; + }; + # Nixflix sets Restart=on-failure but doesn't set RestartSec or # StartLimitBurst, so rapid restarts hit the systemd default rate # limit (5 failures / 10s) and the unit is permanently stopped. diff --git a/modules/hosts/203-media.nix b/modules/hosts/203-media.nix index cb0e843..426c5bb 100644 --- a/modules/hosts/203-media.nix +++ b/modules/hosts/203-media.nix @@ -58,7 +58,7 @@ # directly reachable on ens19 regardless of address-assignment timing. networking.localCommands = '' ip route flush table 203 2>/dev/null || true - ip route add default via 192.168.3.1 dev ens19 table 203 onlink + ip route add default via 192.168.3.1 onlink dev ens19 table 203 ip rule del from 192.168.3.203 lookup 203 2>/dev/null || true ip rule add from 192.168.3.203 lookup 203 '';