Problem: it's not enough to issue 'systemctl start nfs-server.service' once to bring up NFSD. It's necessary to do it twice to bring NFS to work. Seems like it doesn't wait for nfsd kernel module init when the latter is unloaded initially. Preloading nfsd.ko fixes the problem. Reproduces for me. I've disabled NFS-related services by default, but it must not affect the case, I think. Example is below. Note 'Function not implemented' error. umount and 'modprobe -r' are there to reset system to the initial state. # lsmod | grep -c nfsd 0 # systemctl start nfs-server.service Job for nfs-server.service failed. See 'systemctl status nfs-server.service' and 'journalctl -xn' for details. # systemctl status nfs-server.service nfs-server.service - NFS Server Loaded: loaded (/usr/lib/systemd/system/nfs-server.service; disabled) Active: failed (Result: exit-code) since Wed 2014-02-19 13:23:26 EET; 6s ago Process: 3400 ExecStopPost=/usr/sbin/exportfs -f (code=exited, status=1/FAILURE) Process: 3397 ExecStop=/usr/sbin/rpc.nfsd 0 (code=exited, status=1/FAILURE) Process: 3365 ExecStartPost=/usr/libexec/nfs-utils/scripts/nfs-server.postconfig (code=exited, status=0/SUCCESS) Process: 3350 ExecStart=/usr/sbin/rpc.nfsd $RPCNFSDARGS $RPCNFSDCOUNT (code=exited, status=0/SUCCESS) Process: 3495 ExecStartPre=/usr/sbin/exportfs -r (code=exited, status=1/FAILURE) Process: 3490 ExecStartPre=/usr/libexec/nfs-utils/scripts/nfs-server.preconfig (code=exited, status=0/SUCCESS) Main PID: 3350 (code=exited, status=0/SUCCESS) Feb 19 13:23:26 localhost exportfs[3495]: exportfs: 192.168.56.101:/mnt/oth/export: Function not implemented Feb 19 13:23:26 localhost systemd[1]: nfs-server.service: control process exited, code=exited status=1 Feb 19 13:23:26 localhost systemd[1]: Failed to start NFS Server. Feb 19 13:23:26 localhost systemd[1]: Unit nfs-server.service entered failed state. # lsmod | grep -c nfsd 5 # killall -0 nfsd nfsd: no process found # systemctl start nfs-server.service # killall -0 nfsd # systemctl status nfs-server.service nfs-server.service - NFS Server Loaded: loaded (/usr/lib/systemd/system/nfs-server.service; disabled) Active: active (exited) since Wed 2014-02-19 13:24:44 EET; 14s ago Process: 3400 ExecStopPost=/usr/sbin/exportfs -f (code=exited, status=1/FAILURE) Process: 3397 ExecStop=/usr/sbin/rpc.nfsd 0 (code=exited, status=1/FAILURE) Process: 3537 ExecStartPost=/usr/libexec/nfs-utils/scripts/nfs-server.postconfig (code=exited, status=0/SUCCESS) Process: 3521 ExecStart=/usr/sbin/rpc.nfsd $RPCNFSDARGS $RPCNFSDCOUNT (code=exited, status=0/SUCCESS) Process: 3519 ExecStartPre=/usr/sbin/exportfs -r (code=exited, status=0/SUCCESS) Process: 3517 ExecStartPre=/usr/libexec/nfs-utils/scripts/nfs-server.preconfig (code=exited, status=0/SUCCESS) Main PID: 3521 (code=exited, status=0/SUCCESS) CGroup: /system.slice/nfs-server.service Feb 19 13:24:44 localhost systemd[1]: Starting NFS Server... Feb 19 13:24:44 localhost systemd[1]: Started NFS Server. # systemctl stop nfs-server.service # umount /proc/fs/nfsd # modprobe -r nfsd # killall -0 nfsd nfsd: no process found # lsmod | grep -c nfsd 0 # modprobe nfsd # systemctl start nfs-server.service # killall -0 nfsd # systemctl status nfs-server.service nfs-server.service - NFS Server Loaded: loaded (/usr/lib/systemd/system/nfs-server.service; disabled) Active: active (exited) since Wed 2014-02-19 13:26:33 EET; 9s ago Process: 3595 ExecStartPost=/usr/libexec/nfs-utils/scripts/nfs-server.postconfig (code=exited, status=0/SUCCESS) Process: 3580 ExecStart=/usr/sbin/rpc.nfsd $RPCNFSDARGS $RPCNFSDCOUNT (code=exited, status=0/SUCCESS) Process: 3576 ExecStartPre=/usr/sbin/exportfs -r (code=exited, status=0/SUCCESS) Process: 3573 ExecStartPre=/usr/libexec/nfs-utils/scripts/nfs-server.preconfig (code=exited, status=0/SUCCESS) Main PID: 3580 (code=exited, status=0/SUCCESS) CGroup: /system.slice/nfs-server.service Feb 19 13:26:33 localhost systemd[1]: Started NFS Server.
Sorry, forgot this. SW versions: nfs-utils-1.2.9-3.0.fc20.x86_64 libnfsidmap-0.25-7.fc20.x86_64 systemd-208-9.fc20.x86_64 kernel 3.12.10-300.fc20.x86_64
I'm thinking this a more a systemd issued than an nfs-utils problem.... reassigning...
(In reply to Steve Dickson from comment #2) > I'm thinking this a more a systemd issued than an nfs-utils problem.... > reassigning... The following patch works for me: Order nfs-server.service after /proc/fs/nsfd and /var/lib/nfs/rpc_pipefs diff --git usr/lib/systemd/system/nfs-server.service etc/systemd/system/nfs-server.service index 8d05584..1f7bef5 100644 --- usr/lib/systemd/system/nfs-server.service +++ etc/systemd/system/nfs-server.service @@ -2,6 +2,7 @@ Description=NFS Server Requires=proc-fs-nfsd.mount var-lib-nfs-rpc_pipefs.mount rpcbind.service Requires=nfs-idmap.service nfs-mountd.service nfs-rquotad.service +After=proc-fs-nfsd.mount var-lib-nfs-rpc_pipefs.mount rpcbind.service After=network.target named.service nfs-lock.service [Service]
I just checked nfs-utils-1.3.0-2.4.fc20.x86_64.rpm and the issue seams to be still there. [stirabos@t440s nfs]$ cat /usr/lib/systemd/system/nfs-server.service [Unit] Description=NFS Server Requires=proc-fs-nfsd.mount var-lib-nfs-rpc_pipefs.mount rpcbind.service Requires=nfs-idmap.service nfs-mountd.service nfs-rquotad.service After=network.target named.service nfs-lock.service [Service] Type=oneshot RemainAfterExit=yes StandardError=syslog+console EnvironmentFile=-/etc/sysconfig/nfs ExecStartPre=/usr/libexec/nfs-utils/scripts/nfs-server.preconfig ExecStartPre=/usr/sbin/exportfs -r ExecStart=/usr/sbin/rpc.nfsd $RPCNFSDARGS $RPCNFSDCOUNT ExecStartPost=-/usr/libexec/nfs-utils/scripts/nfs-server.postconfig ExecStop=/usr/sbin/rpc.nfsd 0 ExecStopPost=/usr/sbin/exportfs -f ExecReload=/usr/sbin/exportfs -r [Install] WantedBy=nfs.target Also=nfs.target It's still missing 'After=proc-fs-nfsd.mount var-lib-nfs-rpc_pipefs.mount rpcbind.service' and so the issue. It seams to be OK on nfs-utils-1.3.1-4.1.fc21.x86_64.rpm for Fedora 21.
Right, still in f20. 'exportfs -r' (in ExecStartPre) fails if the nfs module is not loaded: # lsmod | grep nfs # ... EMPTY ... Then, 'service nfs start' does exportfs -r: # exportfs -r exportfs: server:/some/dir: Function not implemented exportfs: server:/some/other/dir: Function not implemented How reproducible: This happens only after fresh system installation and system update. Then: # yum install nfs-utils # # put something under /etc/exports.d # systemctl start nfs-server
This message is a reminder that Fedora 20 is nearing its end of life. Approximately 4 (four) weeks from now Fedora will stop maintaining and issuing updates for Fedora 20. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '20'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 20 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
OK in F21 & F22. NFS modules are loaded into kernel automatically after package installation (did not try to look where exactly, making it clear here in bugzilla would be really fine ;)). However, no need to do 'service nfs-server start' twice, no need to keep this opened.