From: Luca BRUNO Date: Mon, 27 Apr 2020 10:06:07 +0000 (+0000) Subject: fstrim: run service and timer only if /etc/fstab is present X-Git-Tag: v2.36-rc1~128^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=dac72b6e7e64844afb686d5d4b640df50028ddbb;p=thirdparty%2Futil-linux.git fstrim: run service and timer only if /etc/fstab is present 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 --- diff --git a/sys-utils/fstrim.service.in b/sys-utils/fstrim.service.in index bf8d3645e4..38472d9937 100644 --- a/sys-utils/fstrim.service.in +++ b/sys-utils/fstrim.service.in @@ -1,6 +1,7 @@ [Unit] Description=Discard unused blocks on filesystems from /etc/fstab Documentation=man:fstrim(8) +ConditionPathExists=/etc/fstab ConditionVirtualization=!container [Service] diff --git a/sys-utils/fstrim.timer b/sys-utils/fstrim.timer index 54b3c18f59..b9e4d577ca 100644 --- a/sys-utils/fstrim.timer +++ b/sys-utils/fstrim.timer @@ -1,6 +1,7 @@ [Unit] Description=Discard unused blocks once a week Documentation=man:fstrim +ConditionPathExists=/etc/fstab ConditionVirtualization=!container [Timer]