Commit graph

6 commits

Author SHA1 Message Date
Luca BRUNO
dac72b6e7e
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 <luca.bruno@coreos.com>
2020-04-27 10:08:53 +00:00
Sami Kerola
f0158208a9
fstrim: randomize timer start time across 100 minutes
It should not matter when exactly fstrim runs, so spread these tasks across
time to help server farms and such to simultanously get busy with io.

Addresses: https://bugs.launchpad.net/bugs/1833593
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2020-02-15 15:24:01 +00:00
Eric Desrochers
0280d31a2b fstrim shouldn't run inside a container
Container type implies the following products:
openvz	OpenVZ/Virtuozzo
lxc	Linux container implementation by LXC
lxc-libvirt	Linux container implementation by libvirt
systemd-nspawn	systemd's minimal container implementation, see systemd-nspawn(1)
docker	Docker container manager
podman	Podman container manager
rkt	rkt app container runtime
wsl	Windows Subsystem for Linux

References:
https://www.freedesktop.org/software/systemd/man/systemd.unit.html
https://www.freedesktop.org/software/systemd/man/systemd-detect-virt.html#

Fix: #840

Signed-off-by: Eric Desrochers <eric.desrochers@canonical.com>
2019-08-14 13:31:25 -04:00
Peter Hoeg
1a2e4a94fc fstrim: systemd timer units should be WantedBy=timers.target
[kzak@redhat.com: - this configuration is recommended by systemd docs]

Signed-off-by: Karel Zak <kzak@redhat.com>
2016-01-12 10:30:36 +01:00
Karel Zak
a39461d355 fstrim: daily -> weekly in systemd timer
* add link to fstrimg man page
 * less aggressive frequency

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-10 09:38:17 +02:00
Thomas Bächler
877cd8944b fstrim: add systemd units
This adds a timer and a service for systemd that runs
fstrim -a once a day.

The Persistent=true option used will only work on systemd 212
or newer.
2014-04-07 12:38:18 +02:00