Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.kernel > #75849 > unrolled thread

Bug#1014429: nfs-utils: rpc_pipefs mounted twice

Started byAndreas Hasenack <andreas@canonical.com>
First post2022-07-05 23:10 +0200
Last post2023-07-09 11:00 +0200
Articles 4 — 2 participants

Back to article view | Back to linux.debian.kernel


Contents

  Bug#1014429: nfs-utils: rpc_pipefs mounted twice Andreas Hasenack <andreas@canonical.com> - 2022-07-05 23:10 +0200
    Bug#1014429:  Andreas Hasenack <andreas@canonical.com> - 2022-07-05 23:30 +0200
    Bug#1014429:  Andreas Hasenack <andreas@canonical.com> - 2022-07-21 21:20 +0200
    Bug#1014429: marked as done (nfs-utils: rpc_pipefs mounted twice) "Debian Bug Tracking System" <owner@bugs.debian.org> - 2023-07-09 11:00 +0200

#75849 — Bug#1014429: nfs-utils: rpc_pipefs mounted twice

FromAndreas Hasenack <andreas@canonical.com>
Date2022-07-05 23:10 +0200
SubjectBug#1014429: nfs-utils: rpc_pipefs mounted twice
Message-ID<EFXXX-9mQl-5@gated-at.bofh.it>
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

[toc] | [next] | [standalone]


#75851 — Bug#1014429:

FromAndreas Hasenack <andreas@canonical.com>
Date2022-07-05 23:30 +0200
SubjectBug#1014429:
Message-ID<EFYhj-9mX8-3@gated-at.bofh.it>
In reply to#75849
Ok, my current theory is this, please poke holes:

autofs and nfs-common are both unpacked. Then the setup begins.

If autofs is setup first, it means systemctl daemon-reload will be
called at the end, and that will run all the generators. Since
nfs-common is already unpacked, it's generator is on disk, and will be
run.

But /etc/nfs.conf doesn't exist yet: it's produced by ucf in
nfs-common's postinst. That means the generator will not be able to
fetch the pipefs-directory config, and will just exit silently. But
autofs is being started, and it requires rpc_pipefs.target, but at
this time, that target unit is the one from the nfs-common package
that will trigger the var-lib-nfs-rpc_pipefs.mount unit.

Then nfs-common is setup. This time, it will produce /etc/nfs.conf,
and when systemctl daemon-reload is called and the generator run, it
will find /etc/nfs.conf, and the pipefs-directory setting, and see
it's different from the default, and produce the generated target and
mount files, which will mount rpc_pipefs in /run/rpc_pipefs now.

[toc] | [prev] | [next] | [standalone]


#75981 — Bug#1014429:

FromAndreas Hasenack <andreas@canonical.com>
Date2022-07-21 21:20 +0200
SubjectBug#1014429:
Message-ID<ELJSh-cTvy-15@gated-at.bofh.it>
In reply to#75849
I created a salsa PR with my attempt at fixing this:

https://salsa.debian.org/kernel-team/nfs-utils/-/merge_requests/18

[toc] | [prev] | [next] | [standalone]


#79549 — Bug#1014429: marked as done (nfs-utils: rpc_pipefs mounted twice)

From"Debian Bug Tracking System" <owner@bugs.debian.org>
Date2023-07-09 11:00 +0200
SubjectBug#1014429: marked as done (nfs-utils: rpc_pipefs mounted twice)
Message-ID<GPyqR-40pn-9@gated-at.bofh.it>
In reply to#75849

[Multipart message — attachments visible in raw view] — view raw

Your message dated Sun, 09 Jul 2023 08:49:04 +0000
with message-id <E1qIQ6K-009SoC-Hs@fasolo.debian.org>
and subject line Bug#1014429: fixed in nfs-utils 1:2.6.3-1
has caused the Debian Bug report #1014429,
regarding nfs-utils: rpc_pipefs mounted twice
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
1014429: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1014429
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.kernel


csiph-web