nfs – the fsc option is ignored when trying to use cachefilesd on Ubuntu 18.04

I'm trying to configure cachefilesd on an nfs share with one of my servers. It does not work.

The service is running, my drives are mounted, but it seems that the option "fsc" is completely ignored.

My fstab (names of specific files edited for reasons of confidentiality and relevance):

$ cat / etc / fstab
#                                                                                                                        



UUID = c456dea4-e0c6-42f5-a206-d0ed2e94bc6a / ext4 rw, memory, deviation, data = ordered 0 1
UUID = 693dee2e-78bb-4d4d-84e4-082328488cfe / boot ext4 rw, real time, deviation, data = commanded 0 2
UUID = 843c20a9-258a-4078-bb78-0549217623e4 No exchange by default 0 0
192.168.200.20:/mnt/tank/share1/mnt/share1 nfs4 nolock, noatime, context = "system_u: object_r: httpd_sys_content_rw_t: s0" 0 0
192.168.200.20:/mnt/tank/share2/mnt/ sub / share2 nfs4 fsc, nolock, noatime 0 0
192.168.200.20:/mnt/tank/share3/mnt/ sub / share3 nfs4 nolock, noatime 0 0
192.168.200.20:/mnt/tank/share4/mnt/ sub / share4 nfs4 fsc, nolock, noatime 0 0

The problem

Whatever I do, even when manually editing shares (mount -t -o fsc …), the FSC option is not enabled:

$ cat / proc / fs / nfsfs / volumes
NV SERVER PORT FAST FSID FSC
v4 c0a8c814 801 0:55 c7d8b1ef: bb64cbde no
v4 c0a8c814 801 0:54 d9a63e22: cc9a3fde no
v4 c0a8c814 801 0:57 5a567c31: 75f052de no
v4 c0a8c814 801 0:59 1673eeb4: b0583de no
v4 c0a8c814 801 0:60 9acb69e2: fb267bde no
v4 c0a8c814 801 0:58 a367662d: 5b53a6of no
v4 c0a8c814 801 0:61 69fdc16c: c38e18de no
v4 c0a8c814 801 0:63 706408fe: 60f412of no
v4 c0a8c814 801 0:64 af123987: 8f7131of no

And looking at nfsstat, you can see that the fsc option has been completely ignored:

$ nfsstat -m
/ mnt / sub / share4 from 192.168.200.20:/mnt/tank/share4
Flags: rw, noatime, to = 4.1, rsize = 131072, wsize = 131072, namlen = 255, hard, proto = tcp, time = 600, retrans = 2, sec = sys, clientaddr = 192.168.200.10, local_lock = none, addr = 192.168.200.20

/ mnt / sub / share3 from 192.168.200.20:/mnt/tank/share3
Flags: rw, noatime, to = 4.1, rsize = 131072, wsize = 131072, namlen = 255, hard, proto = tcp, time = 600, retrans = 2, sec = sys, clientaddr = 192.168.200.10, local_lock = none, addr = 192.168.200.20

/ mnt / share1 from 192.168.200.20:/mnt/tank/share1
Flags: rw, noatime, to = 4.1, rsize = 131072, wsize = 131072, namlen = 255, hard, proto = tcp, time = 600, retrans = 2, sec = sys, clientaddr = 192.168.200.10, local_lock = none, addr = 192.168.200.20

/ mnt / sub / share2 from 192.168.200.20:/mnt/tank/share2
Flags: rw, noatime, to = 4.1, rsize = 131072, wsize = 131072, namlen = 255, hard, proto = tcp, time = 600, retrans = 2, sec = sys, clientaddr = 192.168.200.10, local_lock = none, addr = 192.168.200.20

Troubleshooting Information

The service is running:

$ sudo systemctl status cachefilesd.service
● cachefilesd.service - LSB: CacheFiles daemon
Loaded: loaded (/etc/init.d/cachefilesd; generated)
Active: active since Tuesday 2019-04-30 04:05:28 UTC; 5min ago
Docs: man: systemd-sysv-generator (8)
Process: 21405 ExecStop = / etc / init.d / cachefilesd stop (code = left, status = 0 / SUCCESS)
Process: 22001 ExecStart = /etc/init.d/cachefilesd start (code = left, status = 0 / SUCCESS)
Tasks: 1 (limit: 4915)
CGroup: /system.slice/cachefilesd.service
2022022 / sbin / cachefilesd

Apr 30 4:05:28 AM orochi systemd[1]: Starting LSB: CacheFiles daemon ...
Apr 30 4:05:28 AM orochi cachefilesd[22001]: * Starting the FilesCache daemon cachefilesd
Apr 30 4:05:28 AM orochi cachefilesd[22020]: About to bind the cache
Apr 30 4:05:28 AM orochi cachefilesd[22020]: Linked cache
Apr 30 4:05:28 AM orochi cachefilesd[22022]: Demon Started
Apr 30 4:05:28 AM orochi cachefilesd[22001]:    ...completed.
Apr 30 4:05:28 AM orochi systemd[1]: Started LSB: CacheFiles Daemon.

the option RUN = yes is not commented on:

$ cat / etc / default / cachefilesd
# Default values ​​for cachefilesd initscript
# sourced by /etc/init.d/cachefilesd

# You must remove the comment from the line run = yes below so that cachefilesd can start.
# Before that, read /usr/share/doc/cachefilesd/howto.txt.gz as
# Extended user attributes must be enabled on the cached file system.
RUN = yes

# Additional options passed to the daemon.
DAEMON_OPTS = ""

The option secctx system_u: system_r: cachefiles_kernel_t: s0 has no comments (tried both with and without):

$ cat /etc/cachefilesd.conf
### ##############################
#
# Copyright (C) 2006,2010 Red Hat, Inc. All Rights Reserved.
# Written by David Howells (dhowells@redhat.com)
#
# This program is free software. you can redistribute it and / or
# modifies it according to the terms of the GNU General Public License
# as published by the Free Software Foundation; the version
# 2 of the license, or (at your option) any later version.
#
### ##############################

dir / var / cache / fscache
mycache tag
brown 10%
about 7%
bstop 3%
from 10%
about 7%
fstop 3%

# Assuming you are using SELinux with the default security policy included in
# this package
secctx system_u: system_r: cachefiles_kernel_t: s0

In a similar but ultimately useless answer, someone also included the result:

$ lsmod | grep cachefiles
cachefiles 45056 1
fscache 61440 3 cachefiles, nfsv4, nfs

and that:

$ grep CONFIG_NFS_FSCACHE /boot/config-4.15.0-20-generic
CONFIG_NFS_FSCACHE = y