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:
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...
(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.
I would say lets move this to a systemd bug and see what they say...
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.
*** This bug has been marked as a duplicate of bug 802770 ***