nfs-kernel-server does not start because of dependency failure
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
nfs-utils (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Xenial |
Fix Released
|
Undecided
|
Unassigned | ||
Zesty |
Fix Released
|
Undecided
|
Unassigned | ||
Bionic |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
NOTE FOR THIS BUG (READ THIS BEFORE POSTING)
Whoever finds this and thinks is facing this same problem, please, be aware that disabling all NFS related SysV init scripts (/etc/init.d) is advised before posting here you are also suffering from this same issue.
There was an ORIGINAL ISSUE with *systemd units* and NOT the units that are created automatically by systemd because of existing SysV (/etc/init.d) files being still enabled.
Having enabled units that are automatically generated by systemd on behalf of /etc/init.d (specially after upgrades) can indeed cause dependency issues and the fix for this is to have ONLY systemd units enabled for NFS services.
If not totally understand, completely uninstall nfs-kernel-server and related packages, purge configs, install nfs-kernel-server package again and that will make sure systemd units are used by default.
------------
[Impact]
* nfs-mountd doesn't get started because of a race condition happening when rpcbind.socket is not specified as a needed service for it to start.
* nfs-server using rpcbind.target instead of using rpcbind.socket. Target should not be used (Comment #24)
[Test Case]
* Install nfs-kernel-server inside a xenial lxc guest and restart it until nfs-mountd doesn't start complaining on rpc error.
* Comment #25
[Regression Potential]
* Cons: Systemd dependencies could brake for nfs-server and nfs-mountd.
* Pros: Patches have been accepted upstream (and tested).
[Other Info]
# Original Bug Description
Immediately after boot:
root@feynmann:~# systemctl status nfs-kernel-server
● nfs-server.service - NFS server and services
Loaded: loaded (/lib/systemd/
Active: inactive (dead)
Jun 09 14:35:47 feynmann systemd[1]: Dependency failed for NFS server and services.
Jun 09 14:35:47 feynmann systemd[1]: nfs-server.service: Job nfs-server.
root@feynmann:~# systemctl status nfs-mountd.service
● nfs-mountd.service - NFS Mount Daemon
Loaded: loaded (/lib/systemd/
Active: failed (Result: exit-code) since Thu 2016-06-09 14:35:47 BST; 7min ago
Process: 1321 ExecStart=
Jun 09 14:35:47 feynmann systemd[1]: Starting NFS Mount Daemon...
Jun 09 14:35:47 feynmann rpc.mountd[1321]: mountd: could not create listeners
Jun 09 14:35:47 feynmann systemd[1]: nfs-mountd.service: Control process exited, code=exited
Jun 09 14:35:47 feynmann systemd[1]: Failed to start NFS Mount Daemon.
Jun 09 14:35:47 feynmann systemd[1]: nfs-mountd.service: Unit entered failed state.
Jun 09 14:35:47 feynmann systemd[1]: nfs-mountd.service: Failed with result 'exit-code'.
root@feynmann:~# systemctl list-dependencies nfs-kernel-server
nfs-kernel-
● ├─auth-
● ├─nfs-config.
● ├─nfs-idmapd.
● ├─nfs-mountd.
● ├─proc-
● ├─rpc-svcgssd.
● ├─system.slice
● ├─network.target
● └─rpcbind.target
● └─rpcbind.service
root@feynmann:~# systemctl list-dependencies nfs-mountd.service
nfs-mountd.service
● ├─nfs-config.
● ├─nfs-server.
● ├─proc-
● └─system.slice
root@feynmann:~#
root@feynmann:~# lsb_release -rd
Description: Ubuntu 16.04 LTS
Release: 16.04
root@feynmann:~# apt-cache policy nfs-kernel-server
nfs-kernel-server:
Installed: 1:1.2.8-9ubuntu12
Candidate: 1:1.2.8-9ubuntu12
Version table:
*** 1:1.2.8-9ubuntu12 500
500 http://
100 /var/lib/
Additional comments:
1. There seems to be a circular dependency between nfs-mountd and nfs-kernel-server
2. I can get it working by changing the AFter,Requires in /lib/ssystemd/
3. /usr/lib/
4. A file "/lib/systemd/
Attempted solution:
1. Edit /lib/systemd/
[Unit]
Description=NFS server and services
DefaultDependen
Requires=
# Requires=
Wants=nfs-
After=local-
#After=
After=network.
After=nfs-
#Before=
Before=
...
followed by a systemctl daemon-reload and a reboot.
This results in nfs-kernel-server starting correctly but nfs-mountd not so. However starting nfs-mountd manually after reboot is successful:
root@feynmann:~# systemctl status nfs-kernel-
● nfs-server.service - NFS server and services
Loaded: loaded (/lib/systemd/
Active: active (exited) since Thu 2016-06-09 15:07:23 BST; 1min 25s ago
Process: 1391 ExecStart=
Process: 1384 ExecStartPre=
Main PID: 1391 (code=exited, status=0/SUCCESS)
Tasks: 0
Memory: 0B
CPU: 0
CGroup: /system.
Jun 09 15:07:23 feynmann systemd[1]: Starting NFS server and services...
Jun 09 15:07:23 feynmann systemd[1]: Started NFS server and services.
root@feynmann:~# systemctl status nfs-mountd.service
● nfs-mountd.service - NFS Mount Daemon
Loaded: loaded (/lib/systemd/
Active: inactive (dead)
root@feynmann:~# systemctl start nfs-mountd.service
root@feynmann:~# systemctl status nfs-mountd.service
● nfs-mountd.service - NFS Mount Daemon
Loaded: loaded (/lib/systemd/
Active: active (running) since Thu 2016-06-09 15:09:02 BST; 3s ago
Process: 2044 ExecStart=
Main PID: 2046 (rpc.mountd)
Tasks: 1
Memory: 904.0K
CPU: 12ms
CGroup: /system.
└─2046 /usr/sbin/
Jun 09 15:09:02 feynmann systemd[1]: Starting NFS Mount Daemon...
Jun 09 15:09:02 feynmann rpc.mountd[2046]: Version 1.2.8 starting
Jun 09 15:09:02 feynmann systemd[1]: Started NFS Mount Daemon.
Enabling nfs-mountd.service (systemctl enable nfs-mountd.service) has no effect in this case.
ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: nfs-kernel-server 1:1.2.8-9ubuntu12 [modified: lib/systemd/
ProcVersionSign
Uname: Linux 4.4.0-22-generic x86_64
ApportVersion: 2.20.1-0ubuntu2.1
Architecture: amd64
Date: Thu Jun 9 14:38:58 2016
InstallationDate: Installed on 2016-06-08 (1 days ago)
InstallationMedia: Ubuntu-Server 16.04 LTS "Xenial Xerus" - Release amd64 (20160420.3)
ProcEnviron:
SHELL=/bin/bash
TERM=linux
PATH=(custom, no user)
LANG=en_GB.UTF-8
LANGUAGE=en_GB:en
SourcePackage: nfs-utils
UpgradeStatus: No upgrade log present (probably fresh install)
Changed in nfs-utils (Ubuntu): | |
importance: | Undecided → High |
Changed in nfs-utils (Ubuntu): | |
assignee: | nobody → Rafael David Tinoco (inaddy) |
status: | Confirmed → In Progress |
tags: | added: sts sts-sponsor sts-sru |
description: | updated |
Changed in nfs-utils (Ubuntu): | |
importance: | High → Medium |
Changed in nfs-utils (Ubuntu Xenial): | |
importance: | High → Medium |
tags: | removed: sts-sru |
tags: | added: sts-sru |
tags: |
added: sts-sru-needed removed: sts-sru |
Changed in nfs-utils (Ubuntu Xenial): | |
status: | Fix Committed → Fix Released |
Changed in nfs-utils (Ubuntu Zesty): | |
assignee: | Rafael David Tinoco (rafaeldtinoco) → nobody |
Changed in nfs-utils (Ubuntu Yakkety): | |
assignee: | Rafael David Tinoco (rafaeldtinoco) → nobody |
Changed in nfs-utils (Ubuntu Xenial): | |
assignee: | Rafael David Tinoco (rafaeldtinoco) → nobody |
Changed in nfs-utils (Ubuntu): | |
assignee: | Rafael David Tinoco (rafaeldtinoco) → nobody |
tags: |
added: server-next removed: sts-sru-needed verification-done-xenial verification-needed xenial |
Changed in nfs-utils (Ubuntu Bionic): | |
status: | New → Triaged |
no longer affects: | nfs-utils (Ubuntu Trusty) |
no longer affects: | nfs-utils (Ubuntu Yakkety) |
Status changed to 'Confirmed' because the bug affects multiple users.