Bug 807524 - nfsd won't start under fc16 with systemd
Summary: nfsd won't start under fc16 with systemd
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: nfs-utils
Version: 16
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Steve Dickson
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-03-28 03:40 UTC by Ian Donaldson
Modified: 2012-03-28 12:06 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-03-28 12:06:57 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Ian Donaldson 2012-03-28 03:40:55 UTC
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-28 03:50:44 UTC
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 12:06:57 UTC
(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...


Note You need to log in before you can comment on or make changes to this bug.