Skip to content

Commit

Permalink
fstrim: do not use Protect setting in systemd service
Browse files Browse the repository at this point in the history
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
2d22ac6 we check for read-only volumes and skip it.

References: Upstream: http://github.com/karelzak/util-linux/commit/2d22ac64e4d6e6732640f38b7232b5bcdc84a877
Addresses: #948
Signed-off-by: Karel Zak <kzak@redhat.com>
  • Loading branch information
karelzak committed Feb 4, 2020
1 parent 00e53f1 commit 61b384b
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions sys-utils/fstrim.service.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 61b384b

Please sign in to comment.