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>
[Unit]
Description=Discard unused blocks on filesystems from /etc/fstab
Documentation=man:fstrim(8)
+ConditionPathExists=/etc/fstab
ConditionVirtualization=!container
[Service]
[Unit]
Description=Discard unused blocks once a week
Documentation=man:fstrim
+ConditionPathExists=/etc/fstab
ConditionVirtualization=!container
[Timer]