How to activate rpc-statd.service – mounting nfs

Hi everyone,

I made a previous chaotic post – sorry :fearful: – and thought everything was magically in order, but after the configuration of another laptop, I have troubles again… So I’ll try to be the shorter, the clearer here.

My NFS folder won’t mount on my network unless I add the nolock option:

[tcip@tlap:~]$ sudo mount -t nfs /path/to/network/folder /path/to/mount/point
Failed to start rpc-statd.service: Unit rpc-statd.service not found.
mount.nfs: rpc.statd is not running but is required for remote locking.
mount.nfs: Either use '-o nolock' to keep locks local, or start statd.

I have installed nfs-utils and services.rpcbind.enable is set to true . I can’t find any relevent option in the configuration file – any idea how to enable it?

Thanks and all the best,

PS: I’m running

  • OS: NixOS 19.09.1647.2e73f72c87e (Loris)
  • Kernel: x86_64 Linux 5.4.5
  • Shell: bash 4.4.23

I’m not very familiar with NFS but the tests we have in NixOS do something like this:

{ fileSystems =
    [ { mountPoint = "/data";
        device = "server:/data";
        fsType = "nfs";
      }
    ];
};

If you don’t have any problems with the network filesystem to be mounted automatically I’d go this way.

hi @rnhmjoj
Thanks a lot for your answer – it works indeed flawlessly as I should have reported (like in my previous post).

However, I need to mount my NFS folders by script, since I’m using a laptop and I am not always at home – else, when not on my network, I will have longer boots for naught, and I don’t know why, but my redshift configuration will not load too in this case :thinking:.

For now, I will stick to the nolock option, hoping that nobody will mess with the same file at the same time (which should be easily manageable on a private home NAS).

You should open an issue in nixpkgs: it doesn’t work by default (I can confirm) and, even if possible, it’s at least not well document.

Thanks @rnhmjoj – I’ve opened this issue.