Question

What does nfs-server.service code=exited status=22 mean? [using M. Anderson's tutorial]

Posted September 25, 2016 5.5k views
Networking Ubuntu 16.04

How To Set Up an NFS Mount on Ubuntu 16.04

Posted Aug 4, 2016 9.7k views Networking Ubuntu Ubuntu 16.04

Question for:
https://www.digitalocean.com/community/questions

What does nfs-server.service code=exited status=22 mean? [using M. Anderson’s tutorial]

Log: SetUp NFS Mount Ubuntu 16.04

This tutorial has gotten me further in getting one Ubuntu 16.04 to file share than the other 5 or so, good writing!
Have searched and found no mention of status=22 here or at Ask.Ubuntu. [file folders /status/22/ for another program. ] other nfs-server.service questions do not seem to apply to this situation.

This is a home office LAN with 1 Ubuntu HP 220-110z tower and 1 Ubuntu HP Laptop and one Win 10 Laptop. [connecting with Win 10 is another matter.]

Remote superuser not wanted.

I have been following M. Anderson’s tutorial at:
https://www.digitalocean.com/community/tutorials/how-to-set-up-an-nfs-mount-on-ubuntu-16-04

I did not know what was needed so I included I hope not too much.
I successfully completed up to Step 3 — Configuring the NFS Exports on the Host Server

Brief list of commands completed:

Host:~$ sudo apt-get update
Host:~$ sudo apt-get install nfs-kernel-server
Client:~$ sudo apt-get update
Client:~$ sudo apt-get install nfs-common
Host:~$ sudo mkdir /var/nfs/general -p
Host:~$ sudo chown nobody:nogroup /var/nfs/general

Host:~$ ls -la /var/nfs/general
total 8
drwxr-xr-x 2 nobody nogroup 4096 Sep 23 21:44 .
drwxr-xr-x 3 root   root    4096 Sep 23 21:44 ..
# for Win10 Laptop 

Host:~$ ls -la /home
total 12
drwxr-xr-x  4 root        root        4096 Jul 20 19:48 .
drwxr-xr-x 24 root        root        4096 Sep 24 04:31 ..
drwxr-xr-x 34 luigiwriter luigiwriter 4096 Sep 25 01:38 luigiwriter 
# for Ubuntu 16.04 Tower

Host:~$ sudo sudo nano /etc/exports
/var/nfs/general   192.168.200.255(rw, sync, no_subtree_check)
/home              192.168.200.208(rw, sync, no_subtree_check)
^O
^X

Host:~$ sudo ufw status
Status: active
To                         Action      From
--                         ------      ----
2049                       ALLOW       192.168.200.255           

The Failure Error message occured here.

# ================================================================
Host:~$ sudo systemctl restart nfs-kernel-server
Job for nfs-server.service failed because the control process exited with error code. See "systemctl status nfs-server.service" and "journalctl -xe" for details.

DETAILS

# ================================================================
Host:~$ sudo systemctl status nfs-server.service
# ----------------------------------------------------------------
* nfs-server.service - NFS server and services
   Loaded: loaded (/lib/systemd/system/nfs-server.service; enabled; vendor pre
   Active: FAILED (Result: exit-code) since Sun 2016-09-25 01:33:13 EDT; 57s a <<---*
  Process: 5531 ExecStopPost=/usr/sbin/exportfs -f (code=exited, status=0/SUCC
  Process: 5525 ExecStopPost=/usr/sbin/exportfs -au (code=exited, status=0/SUC
  Process: 5522 ExecStop=/usr/sbin/rpc.nfsd 0 (code=exited, status=0/SUCCESS)
  Process: 1181 ExecStart=/usr/sbin/rpc.nfsd $RPCNFSDARGS (code=exited, status <<---*status=0
  Process: 5825 ExecStartPre=/usr/sbin/exportfs -r (code=exited, status=22)    <<---*status=22
 Main PID: 1181 (code=exited, status=0/SUCCESS)

Sep 25 01:33:13 Hostsystemd[1]: Starting NFS se
Sep 25 01:33:13 Hostexportfs[5825]: exportfs: /
Sep 25 01:33:13 Hostsystemd[1]: nfs-server.serv
Sep 25 01:33:13 Hostsystemd[1]: FAILED TO START                                  <<---*
Sep 25 01:33:13 Hostsystemd[1]: nfs-server.serv
Sep 25 01:33:13 Hostsystemd[1]: nfs-server.serv
# EOF ----------

# ================================================================
Host:~$ sudo journalctl -xe 
# ----------------------------------------------------------------
# Sep 25 01:32:13 is when the failure started.
Sep 25 01:32:13 Hostsudo[5796]: pam_unix(sudo:session): sessi
Sep 25 01:33:13 Hostsudo[5816]: [Host:] TTY=pts/17 ; PW
Sep 25 01:33:13 Hostsudo[5816]: pam_unix(sudo:session): sessi
Sep 25 01:33:13 Hostsystemd[1]: Stopped NFS server and servic
-- Unit nfs-server.service has finished shutting down.                                       <<---*

# In the following, Most repetative lines have been deleted, 
# For example when the -- Subject: and following line are the same message.
# Also deleted the following two lines from each entry:
#    -- Defined-By: systemd
#    -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

Sep 25 01:33:13 Hostsystemd[1]: Starting NFS Mount Daemon...
-- Unit nfs-mountd.service has begun starting up.
Sep 25 01:33:13 Hostsystemd[1]: Starting NFSv4 ID-name mappin
-- Unit nfs-idmapd.service has begun starting up.
Sep 25 01:33:13 Hostsystemd[1]: Started NFSv4 ID-name mapping
-- Unit nfs-idmapd.service has finished starting up.
-- The start-up result is done.

Sep 25 01:33:13 Hostrpc.mountd[5824]: Version 1.2.8 starting
Sep 25 01:33:13 Hostsystemd[1]: Started NFS Mount Daemon.
-- Unit nfs-mountd.service has finished starting up.
-- The start-up result is done.

Sep 25 01:33:13 Hostsystemd[1]: Starting NFS server and servi

# NO FAILURE MESSAGES BEFORE THIS POINT in Journalctl.
-- 
-- Unit nfs-server.service has begun starting up.
Sep 25 01:33:13 Hostexportfs[5825]: exportfs: /etc/exports:1:
Sep 25 01:33:13 Hostsystemd[1]: nfs-server.service: Control p
Sep 25 01:33:13 Hostsystemd[1]: FAILED TO START NFS SERVER AN <<---*

-- UNIT NFS-SERVER.SERVICE HAS FAILED.                <<---*status=22
-- The result is failed.

Sep 25 01:33:13 Hostsystemd[1]: nfs-server.service: Unit ente
Sep 25 01:33:13 Hostsystemd[1]: nfs-server.service: Failed wi <<---*
Sep 25 01:33:13 Hostrpc.mountd[5824]: Caught signal 15, un-re <<---*
Sep 25 01:33:13 Hostsystemd[1]: Stopping NFS Mount Daemon...  <<---*
-- Subject: Unit nfs-mountd.service has begun shutting down
-- 
-- Unit nfs-mountd.service has begun shutting down.
Sep 25 01:33:13 Hostsystemd[1]: Stopping NFSv4 ID-name mappin
-- 
-- Unit nfs-idmapd.service has begun shutting down.
Sep 25 01:33:13 Hostsudo[5816]: pam_unix(sudo:session): sessi
Sep 25 01:33:13 Hostsystemd[1]: Stopped NFS Mount Daemon.
-- Unit nfs-mountd.service has finished shutting down.
-- 
Sep 25 01:33:13 Hostsystemd[1]: Stopped NFSv4 ID-name mapping
-- Unit nfs-idmapd.service has finished shutting down.

This Section repeats 4 times with identical results ———————–

Sep 25 01:34:03 Hostkernel: [UFW BLOCK] IN=enp2s0 OUT= MAC=01:00:5e:00:00:01:a
Sep 25 01:36:08 Hostkernel: [UFW BLOCK] IN=enp2s0 OUT= MAC=01:00:5e:00:00:01:a
Sep 25 01:36:54 Hostsystemd[1]: Starting Automatically refresh installed snaps
-- 
-- Unit snapd.refresh.service has begun starting up.
Sep 25 01:36:55 Host/usr/lib/snapd/snapd[1019]: store.go:539: DEBUG: cannot se
Sep 25 01:36:55 Host/usr/lib/snapd/snapd[1019]: daemon.go:170: DEBUG: uid=0;@ 
Sep 25 01:36:55 Hostsnap[5858]: [4B blob data]
Sep 25 01:36:55 Hostsnap[5858]: All snaps up to date.
Sep 25 01:36:55 Hostsystemd[1]: Started Automatically refresh installed snaps.
-- Unit snapd.refresh.service has finished starting up.
-- 
-- The start-up result is done.

Sep 25 01:36:55 Hostsystemd[1]: snapd.refresh.timer: Adding 3h 59.727602s rand
Sep 25 01:36:55 Hostsystemd[1]: snapd.refresh.timer: Adding 58.845634s random 
Sep 25 01:38:13 Hostkernel: [UFW BLOCK] IN=enp2s0 OUT= MAC=01:00:5e:00:00:01:a
lines 2256-2284/2284 (END)
Sep 25 01:33:13 Hostsystemd[1]: Stopped NFSv4 ID-name mapping service.
-- Subject: Unit nfs-idmapd.service has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- Unit nfs-idmapd.service has finished shutting down.

# End of repeating section ----------------------------------------------------

Sep 25 01:36:55 Hostsystemd[1]: snapd.refresh.timer: Adding 3h 59.727602s random 
Sep 25 01:36:55 Hostsystemd[1]: snapd.refresh.timer: Adding 58.845634s random tim
Sep 25 01:38:13 Hostkernel: [UFW BLOCK] IN=enp2s0 OUT= MAC=01:00:5e:00:00:01:a0:e
lines 2256-2284/2284 (END)
# ===============================================
Tried again here:

Host:~$ sudo systemctl restart nfs-kernel-server
Job for nfs-server.service failed because the control process exited with error code. See "systemctl status nfs-server.service" and "journalctl -xe" for details.
Host:~$ 
edited by kamaln7
1 comment
  • Hi!

    The following lines in your journalctl -xe output seems to be cut off:

    Sep 25 01:33:13 Hostexportfs[5825]: exportfs: /etc/exports:1:
    Sep 25 01:33:13 Hostsystemd[1]: nfs-server.service: Control p
    

    They seem to be the error that we’re looking for, can you please try starting nfs-server.service again and then pasting these lines out of journalctl -xe’s output?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

1 answer

This question was answered by @kamaln7:

Hi!

The following lines in your journalctl -xe output seems to be cut off:

Sep 25 01:33:13 Hostexportfs[5825]: exportfs: /etc/exports:1:
Sep 25 01:33:13 Hostsystemd[1]: nfs-server.service: Control p

They seem to be the error that we’re looking for, can you please try starting nfs-server.service again and then pasting these lines out of journalctl -xe’s output?

View the original comment

Submit an Answer