From f6d22f01dae407b4c6e344290137fac3f1576f86 Mon Sep 17 00:00:00 2001 From: Wojciech Kozlowski Date: Sun, 1 Oct 2023 19:17:00 +0200 Subject: [PATCH] Start using OnSuccess --- playbooks/roles/system/zfs/files/scrub/zfs-scrub@.service | 3 ++- playbooks/roles/system/zfs/files/trim/zfs-trim@.service | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/playbooks/roles/system/zfs/files/scrub/zfs-scrub@.service b/playbooks/roles/system/zfs/files/scrub/zfs-scrub@.service index e44a61f..d1a9159 100644 --- a/playbooks/roles/system/zfs/files/scrub/zfs-scrub@.service +++ b/playbooks/roles/system/zfs/files/scrub/zfs-scrub@.service @@ -6,6 +6,7 @@ After=zfs.target ConditionACPower=true ConditionPathIsDirectory=/sys/module/zfs OnFailure=status-mail@%n.service +OnSuccess=status-mail@%n.service [Service] EnvironmentFile=-/etc/default/zfs @@ -14,4 +15,4 @@ if /usr/sbin/zpool status %i | grep -q "scrub in progress"; then\ exec /usr/sbin/zpool wait -t scrub %i;\ else exec /usr/sbin/zpool scrub -w %i; fi' ExecStop=-/bin/sh -c '/usr/sbin/zpool scrub -p %i 2>/dev/null || true' -ExecStopPost=/bin/sh -c '/usr/local/sbin/systemd-mail-zpool-status %i' +ExecStopPost=/usr/local/sbin/systemd-mail-zpool-status %i diff --git a/playbooks/roles/system/zfs/files/trim/zfs-trim@.service b/playbooks/roles/system/zfs/files/trim/zfs-trim@.service index cb39df5..e3b364e 100644 --- a/playbooks/roles/system/zfs/files/trim/zfs-trim@.service +++ b/playbooks/roles/system/zfs/files/trim/zfs-trim@.service @@ -6,6 +6,7 @@ After=zfs.target ConditionACPower=true ConditionPathIsDirectory=/sys/module/zfs OnFailure=status-mail@%n.service +OnSuccess=status-mail@%n.service [Service] EnvironmentFile=-/etc/default/zfs