2021-12-16 19:47:22 +00:00
|
|
|
[Unit]
|
|
|
|
Description=zpool scrub on %i
|
|
|
|
Documentation=man:zpool-scrub(8)
|
|
|
|
Requires=zfs.target
|
|
|
|
After=zfs.target
|
|
|
|
ConditionACPower=true
|
|
|
|
ConditionPathIsDirectory=/sys/module/zfs
|
|
|
|
|
|
|
|
[Service]
|
2022-02-22 20:59:11 +00:00
|
|
|
EnvironmentFile=-@initconfdir@/zfs
|
2023-06-07 18:14:05 +00:00
|
|
|
ExecStart=/bin/sh -c '\
|
|
|
|
if @sbindir@/zpool status %i | grep -q "scrub in progress"; then\
|
|
|
|
exec @sbindir@/zpool wait -t scrub %i;\
|
|
|
|
else exec @sbindir@/zpool scrub -w %i; fi'
|
|
|
|
ExecStop=-/bin/sh -c '@sbindir@/zpool scrub -p %i 2>/dev/null || true'
|