[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1014429: nfs-utils: rpc_pipefs mounted twice



Package: nfs-utils
Version: 1:2.6.1-2
Severity: normal

Dear Maintainer,

on a fresh debian sid VM, if I "apt install autofs -y", at the end I
will have rpc_pipefs mounted in two places:

root@sid-autofs-nfs-common:~# mount -t rpc_pipefs

root@sid-autofs-nfs-common:~# apt install autofs -y
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  keyutils libevent-core-2.1-7 libldap-2.5-0 libldap-common
libnfsidmap1 libsasl2-2 libsasl2-modules libsasl2-modules-db
nfs-common rpcbind
Suggested packages:
  libsasl2-modules-gssapi-mit | libsasl2-modules-gssapi-heimdal
libsasl2-modules-ldap libsasl2-modules-otp libsasl2-modules-sql
open-iscsi watchdog
The following NEW packages will be installed:
  autofs keyutils libevent-core-2.1-7 libldap-2.5-0 libldap-common
libnfsidmap1 libsasl2-2 libsasl2-modules libsasl2-modules-db
nfs-common rpcbind
0 upgraded, 11 newly installed, 0 to remove and 0 not upgraded.
Need to get 1,408 kB of archives.
After this operation, 4,306 kB of additional disk space will be used.
Get:1 http://deb.debian.org/debian sid/main amd64 autofs amd64
5.1.8-1+b1 [292 kB]
Get:2 http://deb.debian.org/debian sid/main amd64 libevent-core-2.1-7
amd64 2.1.12-stable-5+b1 [137 kB]
Get:3 http://deb.debian.org/debian sid/main amd64 libsasl2-modules-db
amd64 2.1.28+dfsg-6 [38.4 kB]
Get:4 http://deb.debian.org/debian sid/main amd64 libsasl2-2 amd64
2.1.28+dfsg-6 [77.3 kB]
Get:5 http://deb.debian.org/debian sid/main amd64 libldap-2.5-0 amd64
2.5.12+dfsg-2 [227 kB]
Get:6 http://deb.debian.org/debian sid/main amd64 libnfsidmap1 amd64
1:2.6.1-2 [85.0 kB]
Get:7 http://deb.debian.org/debian sid/main amd64 rpcbind amd64
1.2.6-3 [52.0 kB]
Get:8 http://deb.debian.org/debian sid/main amd64 keyutils amd64
1.6.3-1 [61.4 kB]
Get:9 http://deb.debian.org/debian sid/main amd64 nfs-common amd64
1:2.6.1-2 [282 kB]
Get:10 http://deb.debian.org/debian sid/main amd64 libldap-common all
2.5.12+dfsg-2 [72.2 kB]
Get:11 http://deb.debian.org/debian sid/main amd64 libsasl2-modules
amd64 2.1.28+dfsg-6 [84.2 kB]
Fetched 1,408 kB in 1s (2,215 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package autofs.
(Reading database ... 23161 files and directories currently installed.)
Preparing to unpack .../00-autofs_5.1.8-1+b1_amd64.deb ...
Unpacking autofs (5.1.8-1+b1) ...
Selecting previously unselected package libevent-core-2.1-7:amd64.
Preparing to unpack .../01-libevent-core-2.1-7_2.1.12-stable-5+b1_amd64.deb ...
Unpacking libevent-core-2.1-7:amd64 (2.1.12-stable-5+b1) ...
Selecting previously unselected package libsasl2-modules-db:amd64.
Preparing to unpack .../02-libsasl2-modules-db_2.1.28+dfsg-6_amd64.deb ...
Unpacking libsasl2-modules-db:amd64 (2.1.28+dfsg-6) ...
Selecting previously unselected package libsasl2-2:amd64.
Preparing to unpack .../03-libsasl2-2_2.1.28+dfsg-6_amd64.deb ...
Unpacking libsasl2-2:amd64 (2.1.28+dfsg-6) ...
Selecting previously unselected package libldap-2.5-0:amd64.
Preparing to unpack .../04-libldap-2.5-0_2.5.12+dfsg-2_amd64.deb ...
Unpacking libldap-2.5-0:amd64 (2.5.12+dfsg-2) ...
Selecting previously unselected package libnfsidmap1:amd64.
Preparing to unpack .../05-libnfsidmap1_1%3a2.6.1-2_amd64.deb ...
Unpacking libnfsidmap1:amd64 (1:2.6.1-2) ...
Selecting previously unselected package rpcbind.
Preparing to unpack .../06-rpcbind_1.2.6-3_amd64.deb ...
Unpacking rpcbind (1.2.6-3) ...
Selecting previously unselected package keyutils.
Preparing to unpack .../07-keyutils_1.6.3-1_amd64.deb ...
Unpacking keyutils (1.6.3-1) ...
Selecting previously unselected package nfs-common.
Preparing to unpack .../08-nfs-common_1%3a2.6.1-2_amd64.deb ...
Unpacking nfs-common (1:2.6.1-2) ...
Selecting previously unselected package libldap-common.
Preparing to unpack .../09-libldap-common_2.5.12+dfsg-2_all.deb ...
Unpacking libldap-common (2.5.12+dfsg-2) ...
Selecting previously unselected package libsasl2-modules:amd64.
Preparing to unpack .../10-libsasl2-modules_2.1.28+dfsg-6_amd64.deb ...
Unpacking libsasl2-modules:amd64 (2.1.28+dfsg-6) ...
Setting up libsasl2-modules:amd64 (2.1.28+dfsg-6) ...
Setting up rpcbind (1.2.6-3) ...
Created symlink
/etc/systemd/system/multi-user.target.wants/rpcbind.service →
/lib/systemd/system/rpcbind.service.
Created symlink
/etc/systemd/system/sockets.target.wants/rpcbind.socket →
/lib/systemd/system/rpcbind.socket.
Could not execute systemctl:  at /usr/bin/deb-systemd-invoke line 145.
Setting up libldap-common (2.5.12+dfsg-2) ...
Setting up libsasl2-modules-db:amd64 (2.1.28+dfsg-6) ...
Setting up libevent-core-2.1-7:amd64 (2.1.12-stable-5+b1) ...
Setting up libsasl2-2:amd64 (2.1.28+dfsg-6) ...
Setting up keyutils (1.6.3-1) ...
Setting up autofs (5.1.8-1+b1) ...

Creating config file /etc/auto.master with new version

Creating config file /etc/auto.net with new version

Creating config file /etc/auto.misc with new version

Creating config file /etc/auto.smb with new version

Creating config file /etc/autofs.conf with new version

Creating config file /etc/default/autofs with new version
update-rc.d: warning: start and stop actions are no longer supported;
falling back to defaults
Created symlink
/etc/systemd/system/multi-user.target.wants/autofs.service →
/lib/systemd/system/autofs.service.
Setting up libldap-2.5-0:amd64 (2.5.12+dfsg-2) ...
Setting up libnfsidmap1:amd64 (1:2.6.1-2) ...
Setting up nfs-common (1:2.6.1-2) ...

Creating config file /etc/idmapd.conf with new version

Creating config file /etc/nfs.conf with new version
Adding system user `statd' (UID 107) ...
Adding new user `statd' (UID 107) with group `nogroup' ...
Not creating home directory `/var/lib/nfs'.
Created symlink
/etc/systemd/system/multi-user.target.wants/nfs-client.target →
/lib/systemd/system/nfs-client.target.
Created symlink
/etc/systemd/system/remote-fs.target.wants/nfs-client.target →
/lib/systemd/system/nfs-client.target.
auth-rpcgss-module.service is a disabled or a static unit not running,
not starting it.
nfs-idmapd.service is a disabled or a static unit not running, not starting it.
nfs-utils.service is a disabled or a static unit not running, not starting it.
proc-fs-nfsd.mount is a disabled or a static unit not running, not starting it.
rpc-gssd.service is a disabled or a static unit not running, not starting it.
rpc-statd.service is a disabled or a static unit not running, not starting it.
rpc-svcgssd.service is a disabled or a static unit not running, not starting it.
Processing triggers for libc-bin (2.33-7) ...

root@sid-autofs-nfs-common:~# mount -t rpc_pipefs
sunrpc on /run/rpc_pipefs type rpc_pipefs (rw,relatime)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw,relatime)

After a reboot, rpc_pipefs is mounted only at /run/rpc_pipefs (the
expected behavior).

None of this happens if you install just nfs-common: then you only get
the /run/rpc_pipefs mount point at the end (without a reboot).

There is something going on when autofs is in the same "transaction".

The systemd dependency chain seems to be:
autofs.service -> nfs-client.target -> rpc-gssd.service -> rpc_pipefs.target.

There are two rpc_pipefs.target units:
- from the upstream source, which pulls in var-lib-nfs-rpc_pipefs.mount
- the generated one, which pulls in run-rpc_pipefs.mount instead.

The generated one should have precedence and override the package-provided one.

To recap, the rpc-pipefs-generator generator only produces
rpc_pipefs.target and run-rpc_pipefs.mount units when pipefs-directory
in /etc/nfs.conf is different than /var/lib/nfs/rpc_pipefs (the
compiled-in default)[1]. And the generator is run everytime systemctl
daemon-reload is called.

In Ubuntu I also get weird behavior. There, if I "apt install autofs",
I get just one rpc_pipefs mount point but in the wrong place: in
/var/lib/nfs/rpc_pipefs. Strangely enough, this only happens in Ubuntu
when the order of setting up packages is autofs and then nfs-common.
If the order is reversed (nfs-common and then autofs), I only get the
/run/rpc_pipefs mountpoint.

I don't know what the correct fix would be. Could be hard if this is a
race condition.

Maybe one alternative would be to not ship the
var-lib-nfs-rpc_pipefs.mount unit, and patch the generator to always
produce the target and mount units, not just when the pipefs-directory
set in nfs.conf is different than the compiled-in default.


1. https://salsa.debian.org/kernel-team/nfs-utils/-/blob/master/systemd/rpc-pipefs-generator.c#L138


Reply to: