mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-26 03:09:34 +03:00
ccdcc1dbe8
Systemd units do not read @initconfdir@ but refer to variables defined there, also a minor fixup in zfs-scrub service file. Reviewed-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Reviewed-by: George Melikov <mail@gmelikov.ru> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Damian Szuberski <szuberskidamian@gmail.com> Signed-off-by: Krzysztof Piecuch <piecuch@kpiecuch.pl> Closes #12946
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'
|