The timer and service units run `fstrim --fstab`, which strictly depends on `/etc/fstab` being present in the OS. This adds relevant condition statements to the units, in order to skip them and avoid runtime failures. Ref: https://github.com/karelzak/util-linux/issues/673#issuecomment-409246816 Ref: https://github.com/coreos/bugs/issues/2591 Ref: https://github.com/coreos/fedora-coreos-tracker/issues/468 Signed-off-by: Luca BRUNO <luca.bruno@coreos.com>
14 lines
260 B
SYSTEMD
14 lines
260 B
SYSTEMD
[Unit]
|
|
Description=Discard unused blocks once a week
|
|
Documentation=man:fstrim
|
|
ConditionPathExists=/etc/fstab
|
|
ConditionVirtualization=!container
|
|
|
|
[Timer]
|
|
OnCalendar=weekly
|
|
AccuracySec=1h
|
|
Persistent=true
|
|
RandomizedDelaySec=6000
|
|
|
|
[Install]
|
|
WantedBy=timers.target
|