From 801a472e99a2f149bd72f146b9b1984a97feda1f Mon Sep 17 00:00:00 2001 From: fruchti Date: Sat, 27 Apr 2024 14:36:36 +0200 Subject: [PATCH] Status e-mail: Use only main process exit code Previously, the exit code of an ExitStartPre script might have wound up in the e-mail subject. --- options/status-email.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/options/status-email.nix b/options/status-email.nix index 4dfaa74..9477ab7 100644 --- a/options/status-email.nix +++ b/options/status-email.nix @@ -20,7 +20,7 @@ in to="${toAddress}" service="$1" full_status="$(systemctl status --full --lines 200 "$service")" - exit_code="$(echo "$full_status" | head -n5 | tail -1 | sed -e 's/.*status=\(.*\))$/\1/g')" + exit_code="$(echo "$full_status" | head -n5 | tail -1 | sed -e 's/.*ExecStart=.*status=\(.*\))$/\1/g')" # state="$(systemctl is-failed "$service")" fail_priority=1