`systemctl is-active` prints the state AND exits non-zero when a unit is not active, so `... || echo unknown` appended a second line: STATE became "inactive\nunknown" and the script emitted a raw newline inside a JSON string. The scheduler rejected all 14 process checks with "invalid character '\n' in string literal". Latent since the script was written — process checks never actually ran, because checkdefaults wrote an `args` config the ssh-script checker ignored. Passing args through finally executed them and exposed it. - head -1 keeps the state, and the fallback only fires on empty output. - Quotes are stripped from both the unit name and the state; either would break the hand-built JSON just as thoroughly. - signalKind is now the constant "process" rather than "$SERVICE". Emitting the service name minted a distinct signal kind per service (kind=paperless, kind=qbit, …) — nothing an approval_rule can match, and it makes "how many process checks are failing?" unanswerable. Co-Authored-By: Claude <noreply@anthropic.com>
1.5 KiB
1.5 KiB