fstrim: do not use Protect setting in systemd service

The ProtectHome= and ProtectSystem= settings mounts all stuff for the service in read-only mode.

The fstrim ioctl operates on read-only mountpoint file descriptor, but
on some read-only filesystem the operation can fail, so since
2d22ac64e4 we check for read-only volumes and skip it.

References: Upstream: 2d22ac64e4
Addresses: https://github.com/karelzak/util-linux/issues/948
Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
Karel Zak 2020-02-04 16:17:42 +01:00
parent da0debad53
commit ae63d7e832
1 changed files with 0 additions and 2 deletions

View File

@ -6,8 +6,6 @@ ConditionVirtualization=!container
[Service]
Type=oneshot
ExecStart=@sbindir@/fstrim --fstab --verbose --quiet
ProtectSystem=strict
ProtectHome=read-only
PrivateDevices=no
PrivateNetwork=yes
PrivateUsers=no