summaryrefslogtreecommitdiffstats
path: root/etc/systemd/system/[email protected]
blob: 8ffffeb0cf6c9564d31e54cdea592f86dceac2d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
[Unit]
Description=zpool scrub on %i
Documentation=man:zpool-scrub(8)
Requires=zfs.target
After=zfs.target
ConditionACPower=true
ConditionPathIsDirectory=/sys/module/zfs

[Service]
EnvironmentFile=-@initconfdir@/zfs
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'