Start using OnSuccess

This commit is contained in:
Wojciech Kozlowski 2023-10-01 19:17:00 +02:00
parent 4074a45983
commit f6d22f01da
2 changed files with 3 additions and 1 deletions

View File

@ -6,6 +6,7 @@ After=zfs.target
ConditionACPower=true ConditionACPower=true
ConditionPathIsDirectory=/sys/module/zfs ConditionPathIsDirectory=/sys/module/zfs
OnFailure=status-mail@%n.service OnFailure=status-mail@%n.service
OnSuccess=status-mail@%n.service
[Service] [Service]
EnvironmentFile=-/etc/default/zfs 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;\ exec /usr/sbin/zpool wait -t scrub %i;\
else exec /usr/sbin/zpool scrub -w %i; fi' else exec /usr/sbin/zpool scrub -w %i; fi'
ExecStop=-/bin/sh -c '/usr/sbin/zpool scrub -p %i 2>/dev/null || true' 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

View File

@ -6,6 +6,7 @@ After=zfs.target
ConditionACPower=true ConditionACPower=true
ConditionPathIsDirectory=/sys/module/zfs ConditionPathIsDirectory=/sys/module/zfs
OnFailure=status-mail@%n.service OnFailure=status-mail@%n.service
OnSuccess=status-mail@%n.service
[Service] [Service]
EnvironmentFile=-/etc/default/zfs EnvironmentFile=-/etc/default/zfs