mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-27 19:39:35 +03:00
6c96269024
This reverts commit 79b20949b2
since it
doesn't work with the systemd version shipped with RHEL7-based systems.
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rich Ercolani <rincebrain@gmail.com>
Closes #14943
Closes #14945
16 lines
460 B
SYSTEMD
16 lines
460 B
SYSTEMD
[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'
|