Il problema
Il tentativo di avviare NFS (nfs-server.service) su CentOS/RHEL 7 non riesce come segue:
# systemctl status nfs-server.service nfs-server.service - NFS server and services Loaded: loaded (/usr/lib/systemd/system/nfs-server.service; enabled; vendor preset: disabled) Drop-In: /run/systemd/generator/nfs-server.service.d '-order-with-mounts.conf Active: inactive (dead) Mar 09 16:17:10 hostname systemd[1]: Dependency failed for NFS server and services. Mar 09 16:17:10 hostname systemd[1]: nfs-server.service: Job nfs-server.service/start failed with result 'dependency'.
Nel registro di sistema viene riportato anche quanto segue:/var/log/messages:
Mar 9 16:47:34 hostname systemd[1]: nfsdcld.service: Job nfsdcld.service/start failed with result 'dependency'. Mar 9 16:48:23 hostname systemd[1]: proc-fs-nfsd.mount: Directory /proc/fs/nfsd to mount over is not empty, mounting anyway. Mar 9 16:48:23 hostname mount[1889835]: mount: /proc/fs/nfsd: nfsd already mounted on /proc/fs/nfsd. Mar 9 16:48:23 hostname systemd[1]: proc-fs-nfsd.mount: Mount process exited, code=exited status=32 Mar 9 16:48:23 hostname systemd[1]: proc-fs-nfsd.mount: Failed with result 'exit-code'. Mar 9 16:48:23 hostname systemd[1]: nfsdcld.service: Job nfsdcld.service/start failed with result 'dependency'.
La soluzione
Il nfs-server.service richiede e monta il filesystem procfs /proc/fs/nfsd. Se il filesystem /proc/fs/nfsd è già montato, cioè non precedentemente smontato, nfs-server.service non si avvia come descritto.
Segui i passaggi descritti di seguito per risolvere il problema.
1. Smonta manualmente /proc/fs/nfsd :
# umount /proc/fs/nfsd
2. Avvia il servizio NFS:
# systemctl start nfs-server.service