Bug 807524

Summary: nfsd won't start under fc16 with systemd
Product: [Fedora] Fedora Reporter: Ian Donaldson <iand>
Component: nfs-utilsAssignee: Steve Dickson <steved>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 16CC: bfields, jlayton, steved
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-03-28 08:06:57 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Ian Donaldson 2012-03-27 23:40:55 EDT
Description of problem:

NFS server doesn't start as expected on FC16.

 
Version-Release number of selected component (if applicable):

nfs-utils-1.2.5-5.fc16.x86_64


How reproducible:

100%



Steps to Reproduce:
1. systemctl enable nfs.service
   systemctl start nfs.service

2. ps -ef|grep nfsd        ... note isn't running
   netstat  -an |grep 2049 ... note nothing listening
   rpcinfo -p |grep nfs    ... note 'nfs' isn't registered
3.
  
Actual results:

mountd etc are running, but no nfsd.


Expected results:

nfsd running

Additional info:

The default /etc/sysconfig/nfs has RPCNFSDCOUNT commented out,
and /lib/systemd/system/nfs-server.service has this in it:

  ExecStart=/usr/sbin/rpc.nfsd $RPCNFSDARGS ${RPCNFSDCOUNT}

which causes systemd to pass a NULL arg to rpc.nfsd by default, which
causes rpc.nfsd to silently exit without logging anything.  Probably
due to invalid arg detection.

By default, 

strace -e execve -f -p 1 &      shows this:  

[pid  8958] execve("/usr/sbin/rpc.nfsd", ["/usr/sbin/rpc.nfsd", ""], [/* 6 vars */]) = 0

Note the bogus "" arg.

Modifing the  systemd file to have this:

  ExecStart=/usr/sbin/rpc.nfsd $RPCNFSDARGS $RPCNFSDCOUNT

fixes the problem.

Modifying /etc/sysconfig/nfs and uncommenting RPCNFSDCOUNT line also
fixes the problem.

Workaround: uncomment RPCNFSDCOUNT in /etc/sysconfig/nfs


Suggested fix... modify the ExecStart line and remove the {}; I've
tested this works with or without RPCNFSDCOUNT being commented in 
/etc/sysconfig/nfs.
Comment 1 Ian Donaldson 2012-03-27 23:50:44 EDT
Sorry, cancel this.  Seems my /etc/sysconfig/nfs wasn't the default
one; it was from an earlier fedora release which had RPCNFSDCOUNT commented.

The fc16 one doesn't have it commented, so there is no issue per se,
but perhaps the systemd config change I suggested should be done
as it allows for this case.

Also systemd probably should eliminate null args, or is that 
an intentional feature of {}  with it?
Comment 2 Steve Dickson 2012-03-28 08:06:57 EDT
(In reply to comment #1)
> Sorry, cancel this.  Seems my /etc/sysconfig/nfs wasn't the default
> one; it was from an earlier fedora release which had RPCNFSDCOUNT commented.
Unfortunately this have been a very common occurrence. In the 1.2.5-5 version I bumped up the default from one to eight nfsd processes, which should take care of this problem.

> 
> The fc16 one doesn't have it commented, so there is no issue per se,
> but perhaps the systemd config change I suggested should be done
> as it allows for this case.
> 
> Also systemd probably should eliminate null args, or is that 
> an intentional feature of {}  with it?
I have no idea... 

Sorry for the pain...