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

[Service]
EnvironmentFile=-@initconfdir@/zfs
ExecStart=sh -c '\
if zpool status %i | grep -q "(trimming)"; then\
exec zpool wait -t trim %i;\
else exec zpool trim -w %i; fi'
ExecStop=-sh -c 'zpool trim -s %i 2>/dev/null || true'