4

Why my NFS server is stuck in active(exited)? This is the status:

    $ sudo systemctl status nfs-server.service
● nfs-server.service - NFS server and services
     Loaded: loaded (/lib/systemd/system/nfs-server.service; enabled; vendor preset: enabled)
    Drop-In: /run/systemd/generator/nfs-server.service.d
             └─order-with-mounts.conf
     Active: active (exited) since Fri 2021-02-19 12:48:48 CET; 7s ago
    Process: 6257 ExecStartPre=/usr/sbin/exportfs -r (code=exited, status=0/SUCCESS)
    Process: 6258 ExecStart=/usr/sbin/rpc.nfsd $RPCNFSDARGS (code=exited, status=0/SUCCESS)
   Main PID: 6258 (code=exited, status=0/SUCCESS)

Feb 19 12:48:47 xxx_name_xxx systemd[1]: Starting NFS server and services...
Feb 19 12:48:48 xxx_name_xxx systemd[1]: Finished NFS server and services.

This are the logs in /var/log/syslog

Feb 19 12:50:30 xxx_name_xxx systemd-resolved[681]: Server returned error NXDOMAIN, mitigating potential DNS violation DVE-2018-0001, retrying transaction with reduced feature level UDP.
Feb 19 12:50:30 xxx_name_xxx systemd-resolved[681]: message repeated 3 times: [ Server returned error NXDOMAIN, mitigating potential DNS violation DVE-2018-0001, retrying transaction with reduced feature level UDP.]
Feb 19 12:50:30 xxx_name_xxx systemd[1]: Condition check resulted in Kernel Module supporting RPCSEC_GSS being skipped.
Feb 19 12:50:30 xxx_name_xxx systemd[1]: Starting Preprocess NFS configuration...
Feb 19 12:50:30 xxx_name_xxx systemd[1]: nfs-config.service: Succeeded.
Feb 19 12:50:30 xxx_name_xxx systemd[1]: Finished Preprocess NFS configuration.
Feb 19 12:50:30 xxx_name_xxx systemd[1]: Starting NFSv4 ID-name mapping service...
Feb 19 12:50:30 xxx_name_xxx systemd[1]: Starting NFS Mount Daemon...
Feb 19 12:50:30 xxx_name_xxx systemd[1]: Condition check resulted in RPC security service for NFS client and server being skipped.
Feb 19 12:50:30 xxx_name_xxx systemd[1]: Condition check resulted in RPC security service for NFS server being skipped.
Feb 19 12:50:30 xxx_name_xxx systemd-resolved[681]: Server returned error NXDOMAIN, mitigating potential DNS violation DVE-2018-0001, retrying transaction with reduced feature level UDP.
Feb 19 12:50:30 xxx_name_xxx systemd-resolved[681]: Server returned error NXDOMAIN, mitigating potential DNS violation DVE-2018-0001, retrying transaction with reduced feature level UDP.
Feb 19 12:50:30 xxx_name_xxx rpc.mountd[6304]: Version 1.3.3 starting
Feb 19 12:50:30 xxx_name_xxx systemd[1]: Started NFSv4 ID-name mapping service.
Feb 19 12:50:30 xxx_name_xxx systemd[1]: Started NFS Mount Daemon.
Feb 19 12:50:30 xxx_name_xxx systemd[1]: Starting NFS server and services...
Feb 19 12:50:31 xxx_name_xxx kernel: [ 6663.675764] NFSD: Using UMH upcall client tracking operations.
Feb 19 12:50:31 xxx_name_xxx kernel: [ 6663.675771] NFSD: starting 90-second grace period (net f0000098)
Feb 19 12:50:31 xxx_name_xxx systemd[1]: Finished NFS server and services.

This is the result of uname -a:

Linux xxx_name_xxx 5.8.0-7642-generic #47~1612288990~20.04~b8113e7-Ubuntu SMP Wed Feb 3 02:25:36 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

I've tried this and this and tried stopping both nfs-server.service and nfs-client.target and starting only the server but nothing has worked so far. I've seen there were conflicts between the client and the server but I can't believe that it is not possible to use your machine as NFS server and client at the same time.

1 Answer 1

6

Why my NFS server is stuck in active(exited)

Because the NFS server lives in the kernel and does not have a userspace process.

The only job of the rpc.nfsd program is to ask the kernel to start the NFS server kthreads – but those are not associated with the original rpc.nfsd process in any way, and will continue to run even after the process exits.

So the systemd .service's behavior is correct (well, it's the best it can do). It is similar to "starting" iptables or nftables, both of which have no userspace daemon.

To check whether the kernel NFS server is actually running, run ps axf or htop and search for kthreads named "[nfsd]". You can also check information found in /proc/fs/nfsd:

# cat /proc/fs/nfsd/threads
8

# cat /proc/fs/nfsd/versions
-2 +3 +4 +4.1 +4.2

$ ps axf
    PID TTY      STAT   TIME COMMAND
      2 ?        S      0:00 [kthreadd]
    917 ?        S      0:00  \_ [lockd]
   1310 ?        S      0:01  \_ [nfsd]
   1311 ?        S      0:01  \_ [nfsd]
   1312 ?        S      0:02  \_ [nfsd]
3
  • Yes, that's right. I am trying to load the rootfs to a beaglebone black from an NFS and was getting a timeout, so I thought this was the problem but it isn't, thank you very much, now back to the beginning
    – Sanjo
    Feb 19, 2021 at 15:48
  • The kernel NFS server seems to be running, but still the service is active (exited). Is there a way to "restart" NFS ?
    – forzagreen
    Oct 17, 2022 at 8:25
  • 1
    @forzagreen: You can still restart NFS by restarting (or stopping then starting) the service. Because systemd still pretends it's active, it still allows you to systemctl stop it, which will run "ExecStop=rpc.nfsd 0" and stop the NFS kthreads.
    – user1686
    Oct 17, 2022 at 8:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.