Bug 808724

Summary: systemctl restart nfs-server.service can't start nfs-server
Product: [Fedora] Fedora Reporter: WANG Chao <chaowang>
Component: systemdAssignee: systemd-maint
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 17CC: bfields, ccui, chaowang, jlayton, johannbg, metherid, mschmidt, notting, plautrba, qcai, ruyang, steved, systemd-maint
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 808725 (view as bug list) Environment:
Last Closed: 2012-04-16 23:59:21 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 808725    

Description WANG Chao 2012-03-31 10:47:17 UTC
Description of problem:

As systemctl man page said:
restart [NAME...]
Restart one or more units specified on the command line. If the units are not running yet they will be started.

I try start the nfs-server with restart option which is the first time to attempt to start nfs after installation, but `systemctl restart nfs-server.service` fails, while `systemctl start nfs-server.service` is working fine.

/var/log/message:
Mar 30 09:09:22 intel-chiefriver-02 rpc.nfsd[1234]: rpc.nfsd: Unable to access /proc/fs/nfsd errno 2 (No such file or directory).
Mar 30 09:09:22 intel-chiefriver-02 rpc.nfsd[1234]: Please try, as root, 'mount -t nfsd nfsd /proc/fs/nfsd' and then restart rpc.nfsd to correct the problem
Mar 30 09:09:22 intel-chiefriver-02 rpc.nfsd[1234]: error starting threads: errno 38 (Function not implemented)
Mar 30 09:09:22 intel-chiefriver-02 systemd[1]: nfs-server.service: control process exited, code=exited status=1
Mar 30 09:09:22 intel-chiefriver-02 systemd[1]: Unit nfs-server.service entered failed state.

# systemctl status nfs-server.service
nfs-server.service - NFS Server
          Loaded: loaded (/lib/systemd/system/nfs-server.service; disabled)
          Active: failed since Sat, 31 Mar 2012 06:02:07 -0400; 2min 58s ago
         Process: 12071 ExecStart=/usr/sbin/rpc.nfsd $RPCNFSDARGS ${RPCNFSDCOUNT} (code=exited, status=1/FAILURE)
         Process: 12070 ExecStartPre=/usr/sbin/exportfs -r (code=exited, status=0/SUCCESS)
         Process: 12068 ExecStartPre=/usr/sbin/rpc.rquotad $RPCRQUOTADOPTS (code=exited, status=0/SUCCESS)
         Process: 12065 ExecStartPre=/usr/lib/nfs-utils/scripts/nfs-server.preconfig (code=exited, status=0/SUCCESS)
          CGroup: name=systemd:/system/nfs-server.service


Version-Release number of selected component (if applicable):
nfs-utils-1.2.5-12.fc17.x86_64

How reproducible:
100%

Steps to Reproduce:
1.yum install -y nfs-utils
2.systemctl restart nfs-server.service
3.
  
Actual results:
Wont start the service.

Expected results:
Restart should work as start when the service is inactive.


Additional info:

Comment 1 Steve Dickson 2012-04-02 13:06:32 UTC
The problem is on restarts the /proc/fs/nfsd file system is not being mounted which does get mounted on starts.

Here is the Unit section:
[Unit]
Description=NFS Server
Requires=proc-fs-nfsd.mount var-lib-nfs-rpc_pipefs.mount rpcbind.service
After=network.target named.service rpcbind.service proc-fs-nfsd.mount var-lib-nfs-rpc_pipefs.mount

Which clearly states the nfs-server service requires the proc-fs-nfsd.mount service (which does the mount). It also clearly states the nfs-server service has to happen after the proc-fs-nfsd.mount service... 

So its not clear to me what more has to happen from the nfs-utils side...

Comment 2 WANG Chao 2012-04-05 02:34:59 UTC
(In reply to comment #1)
> Which clearly states the nfs-server service requires the proc-fs-nfsd.mount
> service (which does the mount). It also clearly states the nfs-server service
> has to happen after the proc-fs-nfsd.mount service... 
> 
> So its not clear to me what more has to happen from the nfs-utils side...

Yes, I've checked the unit file, and it looks just fine.
But this issue does happen all the time, and `restart` doesn't work like `start`.

What else can I do to debug this issue? If you need more infomation to confirm it's not an nfs-utils issue, plz let me know.

Comment 3 Steve Dickson 2012-04-05 11:20:13 UTC
I would say lets move this to a systemd bug and see what they say...

Comment 4 Michal Schmidt 2012-04-05 13:55:38 UTC
Yes, this is a systemd bug.
Looks like we need to add dependency jobs for JOB_RESTART in transaction_add_job_and_dependencies(), the same as "type == JOB_START" has.

Comment 5 Michal Schmidt 2012-04-16 23:59:21 UTC

*** This bug has been marked as a duplicate of bug 802770 ***