xref: /freebsd/sys/contrib/openzfs/etc/systemd/system/zfs-scrub@.service.in (revision 924226fba12cc9a228c73b956e1b7fa24c60b055)
1[Unit]
2Description=zpool scrub on %i
3Documentation=man:zpool-scrub(8)
4Requires=zfs.target
5After=zfs.target
6ConditionACPower=true
7ConditionPathIsDirectory=/sys/module/zfs
8
9[Service]
10EnvironmentFile=-@initconfdir@/zfs
11ExecStart=/bin/sh -c '\
12if @sbindir@/zpool status %i | grep -q "scrub in progress"; then\
13exec @sbindir@/zpool wait -t scrub %i;\
14else exec @sbindir@/zpool scrub -w %i; fi'
15ExecStop=-/bin/sh -c '@sbindir@/zpool scrub -p %i 2>/dev/null || true'
16