# [SOLVED] Can't start NFS with systemd, works on OpenRC

## TobiSGD

Hi,

I am currently in the progress of migrating some of my systems to systemd. So far everything works fine, except for one thing: I can't start the NFS server on this machine.

```
journalctl -xn
```

 does not show anything, systemctl shows this:

```
>>> systemctl status nfs-server.service 

● nfs-server.service - NFS server and services

   Loaded: loaded (/usr/lib64/systemd/system/nfs-server.service; enabled)

   Active: failed (Result: exit-code) since Wed 2014-07-09 15:38:29 UTC; 26s ago

  Process: 7436 ExecStart=/usr/sbin/rpc.nfsd $RPCNFSDARGS (code=exited, status=1/FAILURE)

  Process: 7433 ExecStartPre=/usr/sbin/exportfs -r (code=exited, status=0/SUCCESS)

 Main PID: 7436 (code=exited, status=1/FAILURE)

Jul 09 15:38:29 demon rpc.nfsd[7436]: rpc.nfsd: writing fd to kernel failed: errno 111 (Connection refused)

Jul 09 15:38:29 demon rpc.nfsd[7436]: rpc.nfsd: unable to set any sockets for nfsd

Jul 09 15:38:29 demon systemd[1]: nfs-server.service: main process exited, code=exited, status=1/FAILURE

Jul 09 15:38:29 demon systemd[1]: Failed to start NFS server and services.

Jul 09 15:38:29 demon systemd[1]: Unit nfs-server.service entered failed state.

```

NFS works fine with OpenRC on that same machine, only systemd can't start it.

Can anybody enlighten me on what I am doing wrong?Last edited by TobiSGD on Wed Jul 09, 2014 8:22 pm; edited 1 time in total

----------

## eccerr0r

Do you have rpcbind/portmap service enabled/started?  (though I would imagine this should be an explicit dependency).

Are you running the same kernel for OpenRC and systemd?

I don't have a systemd machine up right now so I can't check how this is supposed to work at the moment...

----------

## TobiSGD

I found the solution on this forum, but I had to use Google to search it, the search function here is really horrible: https://forums.gentoo.org/viewtopic-t-980072-start-0.html?sid=c509ab2da03dd8c4ea552070a8938bf6 (2nd post)

Indeed, a few sevices had to be started, a few mounts to be made. I wonder why these files are missing for NFS.

----------

