Bug#622394: systemd: nfs-common and rpcbind unit files to fix systemd NFS issues properly
Package: nfs-common
Version: 1:1.2.8-6
Followup-For: Bug #622394
Dear Maintainer,
*** Reporter, please consider answering these questions, where appropriate ***
* What led up to the situation?
When running under systemd:
o NFS mounts from /etc/fstab do not work.
o NFS exports also fail due to rpcbind not starting before nfs-common and nfs-
kernel-server
systemd is the new default system init for linux. The above should just work.
* What exactly did you do (or not do) that was effective (or
ineffective)?
Created my own /etc/tmpfiles.d/rpcbind.conf:
--------
#Type Path Mode UID GID Age Argument
d /run/rpcbind 0755 root root - -
f /run/rpcbind/rpcbind.xdr 0600 root root - -
f /run/rpcbind/portmap.xdr 0600 root root - -
--------
and /lib/systemd/system file (I did this one in /etc/systemd/system):
-------
[Unit]
Description=RPC bind portmap service
After=systemd-tmpfiles-setup.service
Wants=remote-fs-pre.target
Before=remote-fs-pre.target
DefaultDependencies=no
[Service]
ExecStart=/sbin/rpcbind -f -w
KillMode=process
Restart=on-failure
[Install]
WantedBy=sysinit.target
Alias=portmap
--------
and enabled above unit:
# systemctl enable rpcbind.service
Did for nfs-common to make NFS rpc support to start at correct time:
Created /etc/systemd/system/nfs-common.service (can be put in
/lib/systemd/system
--------
[Unit]
Description=NFS Common daemons
Wants=remote-fs-pre.target
DefaultDependencies=no
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/etc/init.d/nfs-common start
ExecStop=/etc/init.d/nfs-common stop
[Install]
WantedBy=sysinit.target
---------
# systemctl enable nfs-common
* What was the outcome of this action?
Rpc Bind starting correctly, with registration state saving over restart, NFS
service working normally
# systemctl status rpcbind
rpcbind.service - RPC bind portmap service
Loaded: loaded (/etc/systemd/system/rpcbind.service; enabled)
Drop-In: /run/systemd/generator/rpcbind.service.d
└─50-rpcbind-$portmap.conf
Active: active (running) since Wed 2014-05-14 10:38:13 NZST; 13min ago
Main PID: 5066 (rpcbind)
CGroup: name=systemd:/system/rpcbind.service
└─5066 /sbin/rpcbind -f -w
May 14 10:38:13 moriah systemd[1]: Started RPC bind portmap service.
# systemctl status nfs-common
nfs-common.service - NFS Common daemons
Loaded: loaded (/etc/systemd/system/nfs-common.service; enabled)
Active: active (exited) since Wed 2014-05-14 10:35:01 NZST; 19min ago
Main PID: 259 (code=exited, status=0/SUCCESS)
CGroup: name=systemd:/system/nfs-common.service
Warning: Journal has been rotated since unit was started. Log output is
incomplete or unavailable.
All the NFS RPC daemons have port activation in latest nfs-utils upstream, and
service files. Please consider using these as the socket activation saves
haing to manually configure which NFS RPC daemons are needed.
-- Package-specific info:
-- rpcinfo --
program vers proto port service
100000 4 tcp 111 portmapper
100000 3 tcp 111 portmapper
100000 2 tcp 111 portmapper
100000 4 udp 111 portmapper
100000 3 udp 111 portmapper
100000 2 udp 111 portmapper
100003 2 tcp 2049 nfs
100003 3 tcp 2049 nfs
100003 4 tcp 2049 nfs
100227 2 tcp 2049
100227 3 tcp 2049
100003 2 udp 2049 nfs
100003 3 udp 2049 nfs
100003 4 udp 2049 nfs
100227 2 udp 2049
100227 3 udp 2049
100021 1 udp 38783 nlockmgr
100021 3 udp 38783 nlockmgr
100021 4 udp 38783 nlockmgr
100021 1 tcp 49538 nlockmgr
100021 3 tcp 49538 nlockmgr
100021 4 tcp 49538 nlockmgr
100005 1 udp 58915 mountd
100005 1 tcp 40052 mountd
100005 2 udp 40524 mountd
100005 2 tcp 60384 mountd
100005 3 udp 55957 mountd
100005 3 tcp 49758 mountd
-- /etc/default/nfs-common --
NEED_STATD=
STATDOPTS=
NEED_IDMAPD=yes
NEED_GSSD=yes
RPCGSSDOPTS=""
-- /etc/idmapd.conf --
[General]
Verbosity = 0
Pipefs-Directory = /run/rpc_pipefs
Domain = internal.anathoth.net
Local-Realms = ANATHOTH.NET
[Translation]
Method = nsswitch
[Mapping]
Nobody-User = nobody
Nobody-Group = nogroup
-- /etc/fstab --
#shalom:/src /media/src nfs noauto,defaults,user,exec 0 0
#shalom:/home /media/home nfs noauto,defaults,user,exec 0 0
#en-gedi:/home /srv/home nfs noauto,async,_netdev,soft,intr,defaults,exec 0 0
-- /proc/mounts --
nfsd /proc/fs/nfsd nfsd rw,relatime 0 0
-- System Information:
Debian Release: jessie/sid
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 3.14-1-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_NZ.utf8, LC_CTYPE=en_NZ.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages nfs-common depends on:
ii adduser 3.113+nmu3
ii initscripts 2.88dsf-53
ii libc6 2.18-5
ii libcap2 1:2.22-1.2
ii libcomerr2 1.42.9-3
ii libdevmapper1.02.1 2:1.02.83-2
ii libevent-2.0-5 2.0.21-stable-1
ii libgssglue1 0.4-2
ii libk5crypto3 1.12.1+dfsg-1
ii libkeyutils1 1.5.6-1
ii libkrb5-3 1.12.1+dfsg-1
ii libmount1 2.20.1-5.7
ii libnfsidmap2 0.25-5
ii libtirpc1 0.2.2-7
ii libwrap0 7.6.q-25
ii lsb-base 4.1+Debian12
ii rpcbind 0.2.1-3
ii ucf 3.0028
Versions of packages nfs-common recommends:
ii python 2.7.5-5
Versions of packages nfs-common suggests:
pn open-iscsi <none>
pn watchdog <none>
Versions of packages nfs-kernel-server depends on:
ii libblkid1 2.20.1-5.7
ii libc6 2.18-5
ii libcap2 1:2.22-1.2
ii libgssglue1 0.4-2
ii libsqlite3-0 3.8.4.3-3
ii libtirpc1 0.2.2-7
ii libwrap0 7.6.q-25
ii lsb-base 4.1+Debian12
ii ucf 3.0028
-- Configuration Files:
/etc/default/nfs-common changed [not included]
-- no debconf information
[Unit]
Description=RPC bind portmap service
After=systemd-tmpfiles-setup.service
Wants=remote-fs-pre.target
Before=remote-fs-pre.target
DefaultDependencies=no
[Service]
ExecStart=/sbin/rpcbind -f -w
KillMode=process
Restart=on-failure
[Install]
WantedBy=sysinit.target
Alias=portmap
[Unit]
Description=NFS Common daemons
Wants=remote-fs-pre.target
DefaultDependencies=no
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/etc/init.d/nfs-common start
ExecStop=/etc/init.d/nfs-common stop
[Install]
WantedBy=sysinit.target
#Type Path Mode UID GID Age Argument
d /run/rpcbind 0755 root root - -
f /run/rpcbind/rpcbind.xdr 0600 root root - -
f /run/rpcbind/portmap.xdr 0600 root root - -
Reply to: