Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#1025099: plocate: autofs pruning doesn't seem to work

58 views
Skip to first unread message

Ross Vandegrift

unread,
Nov 29, 2022, 2:30:03 PM11/29/22
to
Package: plocate
Version: 1.1.17-2
Severity: normal
X-Debbugs-Cc: rvand...@debian.org

Hello,

I noticed that an autofs mount is being triggered by updatedb.plocate:
systemd[1]: mnt-storage.automount: Got automount request for /mnt/storage, triggered by 63669 (updatedb.plocat)

It looks like the bind mount checking is involved. Here's the --debug-pruning
output:

$ sudo journalctl -fu mnt-storage.automount &
$ mount | grep storage
systemd-1 on /mnt/storage type autofs (rw,relatime,fd=55,pgrp=1,timeout=600,minproto=5,maxproto=5,direct,pipe_ino=14748)
$ sudo updatedb.plocate --debug-pruning
conf_block:
prune_bind_mounts\000
1\000
\000
prunefs\000
AFS\000
AUTOFS\000
BINFMT_MISC\000
CEPH\000
CGROUP\000
CGROUP2\000
CIFS\000
CODA\000
CONFIGFS\000
CURLFTPFS\000
DEBUGFS\000
DEVFS\000
DEVPTS\000
DEVTMPFS\000
ECRYPTFS\000
FTPFS\000
FUSE.CEPH\000
FUSE.CRYFS\000
FUSE.ENCFS\000
FUSE.GLUSTERFS\000
FUSE.GOCRYPTFS\000
FUSE.GVFSD-FUSE\000
FUSE.MFS\000
FUSE.RCLONE\000
FUSE.ROZOFS\000
FUSE.SSHFS\000
FUSECTL\000
FUSESMB\000
HUGETLBFS\000
ISO9660\000
LUSTRE\000
LUSTRE_LITE\000
MFS\000
MQUEUE\000
NCPFS\000
NFS\000
NFS4\000
OCFS\000
OCFS2\000
PROC\000
PSTORE\000
RPC_PIPEFS\000
SECURITYFS\000
SHFS\000
SMBFS\000
SYSFS\000
TMPFS\000
TRACEFS\000
UDEV\000
UDF\000
USBFS\000
\000
prunenames\000
\000
prunepaths\000
/home/.ecryptfs\000
/media\000
/tmp\000
/var/lib/ceph\000
/var/lib/os-prober\000
/var/lib/schroot\000
/var/spool\000
\000

-----------------------
Rebuilding bind_mount_paths:
`/sys' (22 on 28) is `/' of `sysfs' (0:20), type `sysfs'
`/proc' (23 on 28) is `/' of `proc' (0:21), type `proc'
`/dev' (24 on 28) is `/' of `udev' (0:5), type `devtmpfs'
`/dev/pts' (25 on 24) is `/' of `devpts' (0:22), type `devpts'
`/run' (26 on 28) is `/' of `tmpfs' (0:23), type `tmpfs'
`/' (28 on 1) is `/' of `/dev/mapper/root' (254:0), type `ext4'
`/sys/kernel/security' (29 on 22) is `/' of `securityfs' (0:6), type `securityfs'
`/dev/shm' (30 on 24) is `/' of `tmpfs' (0:25), type `tmpfs'
`/run/lock' (31 on 26) is `/' of `tmpfs' (0:26), type `tmpfs'
`/sys/fs/cgroup' (32 on 22) is `/' of `cgroup2' (0:27), type `cgroup2'
`/sys/fs/pstore' (33 on 22) is `/' of `pstore' (0:28), type `pstore'
`/sys/firmware/efi/efivars' (34 on 22) is `/' of `efivarfs' (0:29), type `efivarfs'
`/sys/fs/bpf' (35 on 22) is `/' of `bpf' (0:30), type `bpf'
`/proc/sys/fs/binfmt_misc' (37 on 23) is `/' of `systemd-1' (0:31), type `autofs'
`/dev/hugepages' (38 on 24) is `/' of `hugetlbfs' (0:32), type `hugetlbfs'
`/dev/mqueue' (39 on 24) is `/' of `mqueue' (0:19), type `mqueue'
`/sys/kernel/debug' (40 on 22) is `/' of `debugfs' (0:7), type `debugfs'
`/sys/kernel/tracing' (41 on 22) is `/' of `tracefs' (0:12), type `tracefs'
`/sys/kernel/config' (42 on 22) is `/' of `configfs' (0:33), type `configfs'
`/sys/fs/fuse/connections' (43 on 22) is `/' of `fusectl' (0:34), type `fusectl'
`/run/credentials/systemd-sysusers.service' (67 on 26) is `/' of `ramfs' (0:35), type `ramfs'
`/run/credentials/systemd-tmpfiles-setup-dev.service' (69 on 26) is `/' of `ramfs' (0:36), type `ramfs'
`/run/credentials/systemd-sysctl.service' (71 on 26) is `/' of `ramfs' (0:37), type `ramfs'
`/efi' (82 on 28) is `/' of `systemd-1' (0:38), type `autofs'
`/mnt/storage' (100 on 28) is `/' of `systemd-1' (0:39), type `autofs'
`/boot' (103 on 28) is `/' of `/dev/sda1' (8:1), type `vfat'
`/run/credentials/systemd-tmpfiles-setup.service' (135 on 26) is `/' of `ramfs' (0:40), type `ramfs'
`/proc/sys/fs/binfmt_misc' (106 on 37) is `/' of `binfmt_misc' (0:41), type `binfmt_misc'
`/run/rpc_pipefs' (182 on 26) is `/' of `sunrpc' (0:44), type `rpc_pipefs'
`/run/user/1000' (252 on 26) is `/' of `tmpfs' (0:55), type `tmpfs'
`/run/user/1000/doc' (259 on 252) is `/' of `portal' (0:50), type `fuse.portal'
`/efi' (815 on 82) is `/' of `/dev/sda1' (8:1), type `vfat'
Matching bind_mount_paths:
=> adding `/efi' (duplicate of mount point `/boot')
...done
Checking whether filesystem `/boot' is excluded:
`/sys', type `sysfs'
=> type matches, dir `/sys'
`/proc', type `proc'
=> type matches, dir `/proc'
`/dev', type `devtmpfs'
=> type matches, dir `/dev'
`/dev/pts', type `devpts'
=> type matches, dir `/dev/pts'
`/run', type `tmpfs'
=> type matches, dir `/run'
`/', type `ext4'
`/sys/kernel/security', type `securityfs'
=> type matches, dir `/sys/kernel/security'
`/dev/shm', type `tmpfs'
=> type matches, dir `/dev/shm'
`/run/lock', type `tmpfs'
=> type matches, dir `/run/lock'
`/sys/fs/cgroup', type `cgroup2'
=> type matches, dir `/sys/fs/cgroup'
`/sys/fs/pstore', type `pstore'
=> type matches, dir `/sys/fs/pstore'
`/sys/firmware/efi/efivars', type `efivarfs'
`/sys/fs/bpf', type `bpf'
`/proc/sys/fs/binfmt_misc', type `autofs'
=> type matches, dir `/proc/sys/fs/binfmt_misc'
`/dev/hugepages', type `hugetlbfs'
=> type matches, dir `/dev/hugepages'
`/dev/mqueue', type `mqueue'
=> type matches, dir `/dev/mqueue'
`/sys/kernel/debug', type `debugfs'
=> type matches, dir `/sys/kernel/debug'
`/sys/kernel/tracing', type `tracefs'
=> type matches, dir `/sys/kernel/tracing'
`/sys/kernel/config', type `configfs'
=> type matches, dir `/sys/kernel/config'
`/sys/fs/fuse/connections', type `fusectl'
=> type matches, dir `/sys/fs/fuse/connections'
`/run/credentials/systemd-sysusers.service', type `ramfs'
`/run/credentials/systemd-tmpfiles-setup-dev.service', type `ramfs'
`/run/credentials/systemd-sysctl.service', type `ramfs'
`/efi', type `autofs'
=> type matches, dir `/efi'
`/mnt/storage', type `autofs'
=> type matches, dir `/mnt/storage'
`/boot', type `vfat'
`/run/credentials/systemd-tmpfiles-setup.service', type `ramfs'
`/proc/sys/fs/binfmt_misc', type `binfmt_misc'
=> type matches, dir `/proc/sys/fs/binfmt_misc'
`/run/rpc_pipefs', type `rpc_pipefs'
=> type matches, dir `/run/rpc_pipefs'
`/run/user/1000', type `tmpfs'
=> type matches, dir `/run/user/1000'
`/run/user/1000/doc', type `fuse.portal'
`/efi', type `vfat'
...done
Checking whether filesystem `/dev' is excluded:
`/sys', type `sysfs'
=> type matches, dir `/sys'
`/proc', type `proc'
=> type matches, dir `/proc'
`/dev', type `devtmpfs'
=> type matches, dir `/dev'
Checking whether filesystem `/efi' is excluded:
`/sys', type `sysfs'
=> type matches, dir `/sys'
`/proc', type `proc'
=> type matches, dir `/proc'
`/dev', type `devtmpfs'
=> type matches, dir `/dev'
`/dev/pts', type `devpts'
=> type matches, dir `/dev/pts'
`/run', type `tmpfs'
=> type matches, dir `/run'
`/', type `ext4'
`/sys/kernel/security', type `securityfs'
=> type matches, dir `/sys/kernel/security'
`/dev/shm', type `tmpfs'
=> type matches, dir `/dev/shm'
`/run/lock', type `tmpfs'
=> type matches, dir `/run/lock'
`/sys/fs/cgroup', type `cgroup2'
=> type matches, dir `/sys/fs/cgroup'
`/sys/fs/pstore', type `pstore'
=> type matches, dir `/sys/fs/pstore'
`/sys/firmware/efi/efivars', type `efivarfs'
`/sys/fs/bpf', type `bpf'
`/proc/sys/fs/binfmt_misc', type `autofs'
=> type matches, dir `/proc/sys/fs/binfmt_misc'
`/dev/hugepages', type `hugetlbfs'
=> type matches, dir `/dev/hugepages'
`/dev/mqueue', type `mqueue'
=> type matches, dir `/dev/mqueue'
`/sys/kernel/debug', type `debugfs'
=> type matches, dir `/sys/kernel/debug'
`/sys/kernel/tracing', type `tracefs'
=> type matches, dir `/sys/kernel/tracing'
`/sys/kernel/config', type `configfs'
=> type matches, dir `/sys/kernel/config'
`/sys/fs/fuse/connections', type `fusectl'
=> type matches, dir `/sys/fs/fuse/connections'
`/run/credentials/systemd-sysusers.service', type `ramfs'
`/run/credentials/systemd-tmpfiles-setup-dev.service', type `ramfs'
`/run/credentials/systemd-sysctl.service', type `ramfs'
`/efi', type `autofs'
=> type matches, dir `/efi'
Checking whether filesystem `/proc' is excluded:
`/sys', type `sysfs'
=> type matches, dir `/sys'
`/proc', type `proc'
=> type matches, dir `/proc'
Checking whether filesystem `/run' is excluded:
`/sys', type `sysfs'
=> type matches, dir `/sys'
`/proc', type `proc'
=> type matches, dir `/proc'
`/dev', type `devtmpfs'
=> type matches, dir `/dev'
`/dev/pts', type `devpts'
=> type matches, dir `/dev/pts'
`/run', type `tmpfs'
=> type matches, dir `/run'
Checking whether filesystem `/sys' is excluded:
`/sys', type `sysfs'
=> type matches, dir `/sys'
Skipping `/media': in prunepaths
Checking whether filesystem `/mnt/storage' is excluded:
`/sys', type `sysfs'
=> type matches, dir `/sys'
`/proc', type `proc'
=> type matches, dir `/proc'
`/dev', type `devtmpfs'
=> type matches, dir `/dev'
`/dev/pts', type `devpts'
=> type matches, dir `/dev/pts'
`/run', type `tmpfs'
=> type matches, dir `/run'
`/', type `ext4'
`/sys/kernel/security', type `securityfs'
=> type matches, dir `/sys/kernel/security'
`/dev/shm', type `tmpfs'
=> type matches, dir `/dev/shm'
`/run/lock', type `tmpfs'
=> type matches, dir `/run/lock'
`/sys/fs/cgroup', type `cgroup2'
=> type matches, dir `/sys/fs/cgroup'
`/sys/fs/pstore', type `pstore'
=> type matches, dir `/sys/fs/pstore'
`/sys/firmware/efi/efivars', type `efivarfs'
`/sys/fs/bpf', type `bpf'
`/proc/sys/fs/binfmt_misc', type `autofs'
=> type matches, dir `/proc/sys/fs/binfmt_misc'
`/dev/hugepages', type `hugetlbfs'
=> type matches, dir `/dev/hugepages'
`/dev/mqueue', type `mqueue'
=> type matches, dir `/dev/mqueue'
`/sys/kernel/debug', type `debugfs'
=> type matches, dir `/sys/kernel/debug'
`/sys/kernel/tracing', type `tracefs'
=> type matches, dir `/sys/kernel/tracing'
`/sys/kernel/config', type `configfs'
=> type matches, dir `/sys/kernel/config'
`/sys/fs/fuse/connections', type `fusectl'
=> type matches, dir `/sys/fs/fuse/connections'
`/run/credentials/systemd-sysusers.service', type `ramfs'
`/run/credentials/systemd-tmpfiles-setup-dev.service', type `ramfs'
`/run/credentials/systemd-sysctl.service', type `ramfs'
`/efi', type `autofs'
=> type matches, dir `/efi'
`/mnt/storage', type `autofs'
=> type matches, dir `/mnt/storage'
Rebuilding bind_mount_paths:
`/sys' (22 on 28) is `/' of `sysfs' (0:20), type `sysfs'
`/proc' (23 on 28) is `/' of `proc' (0:21), type `proc'
`/dev' (24 on 28) is `/' of `udev' (0:5), type `devtmpfs'
`/dev/pts' (25 on 24) is `/' of `devpts' (0:22), type `devpts'
`/run' (26 on 28) is `/' of `tmpfs' (0:23), type `tmpfs'
`/' (28 on 1) is `/' of `/dev/mapper/root' (254:0), type `ext4'
`/sys/kernel/security' (29 on 22) is `/' of `securityfs' (0:6), type `securityfs'
`/dev/shm' (30 on 24) is `/' of `tmpfs' (0:25), type `tmpfs'
`/run/lock' (31 on 26) is `/' of `tmpfs' (0:26), type `tmpfs'
`/sys/fs/cgroup' (32 on 22) is `/' of `cgroup2' (0:27), type `cgroup2'
`/sys/fs/pstore' (33 on 22) is `/' of `pstore' (0:28), type `pstore'
`/sys/firmware/efi/efivars' (34 on 22) is `/' of `efivarfs' (0:29), type `efivarfs'
`/sys/fs/bpf' (35 on 22) is `/' of `bpf' (0:30), type `bpf'
`/proc/sys/fs/binfmt_misc' (37 on 23) is `/' of `systemd-1' (0:31), type `autofs'
`/dev/hugepages' (38 on 24) is `/' of `hugetlbfs' (0:32), type `hugetlbfs'
`/dev/mqueue' (39 on 24) is `/' of `mqueue' (0:19), type `mqueue'
`/sys/kernel/debug' (40 on 22) is `/' of `debugfs' (0:7), type `debugfs'
`/sys/kernel/tracing' (41 on 22) is `/' of `tracefs' (0:12), type `tracefs'
`/sys/kernel/config' (42 on 22) is `/' of `configfs' (0:33), type `configfs'
`/sys/fs/fuse/connections' (43 on 22) is `/' of `fusectl' (0:34), type `fusectl'
`/run/credentials/systemd-sysusers.service' (67 on 26) is `/' of `ramfs' (0:35), type `ramfs'
`/run/credentials/systemd-tmpfiles-setup-dev.service' (69 on 26) is `/' of `ramfs' (0:36), type `ramfs'
`/run/credentials/systemd-sysctl.service' (71 on 26) is `/' of `ramfs' (0:37), type `ramfs'
`/efi' (82 on 28) is `/' of `systemd-1' (0:38), type `autofs'
`/mnt/storage' (100 on 28) is `/' of `systemd-1' (0:39), type `autofs'
`/boot' (103 on 28) is `/' of `/dev/sda1' (8:1), type `vfat'
`/run/credentials/systemd-tmpfiles-setup.service' (135 on 26) is `/' of `ramfs' (0:40), type `ramfs'
`/proc/sys/fs/binfmt_misc' (106 on 37) is `/' of `binfmt_misc' (0:41), type `binfmt_misc'
`/run/rpc_pipefs' (182 on 26) is `/' of `sunrpc' (0:44), type `rpc_pipefs'
`/run/user/1000' (252 on 26) is `/' of `tmpfs' (0:55), type `tmpfs'
`/run/user/1000/doc' (259 on 252) is `/' of `portal' (0:50), type `fuse.portal'
`/efi' (815 on 82) is `/' of `/dev/sda1' (8:1), type `vfat'
`/mnt/storage' (908 on 100) is `/' of `vanvanmojo.lan:/mnt/storage' (0:70), type `nfs4'
Matching bind_mount_paths:
=> adding `/efi' (duplicate of mount point `/boot')
...done
Skipping `/tmp': in prunepaths
Nov 29 11:08:33 momomoto systemd[1]: mnt-storage.automount: Got automount request for /mnt/storage, triggered by 63669 (updatedb.plocat)
Skipping `/var/lib/os-prober': in prunepaths
Skipping `/var/spool': in prunepaths

Ross

-- System Information:
Debian Release: bookworm/sid
APT prefers unstable
APT policy: (500, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 6.0.0-4-amd64 (SMP w/4 CPU threads; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages plocate depends on:
ii adduser 3.129
ii libc6 2.36-6
ii libgcc-s1 12.2.0-9
ii libstdc++6 12.2.0-9
ii liburing2 2.3-2
ii libzstd1 1.5.2+dfsg-1

plocate recommends no packages.

Versions of packages plocate suggests:
ii powermgmt-base 1.37
ii systemd-sysv 252.1-1

-- no debconf information

Ross Vandegrift

unread,
Nov 29, 2022, 3:10:03 PM11/29/22
to
Control: retitle -1 autofs mount triggered in spite of pruning

On Tue, Nov 29, 2022 at 11:24:03AM -0800, Ross Vandegrift wrote:
> Subject: Bug#1025099: plocate: autofs pruning doesn't seem to work

That subject wasn't too clear- updatedb.plocate does not index the
remote filesystem, it just triggeres the automount unnecessarily.

Ross

Steinar H. Gunderson

unread,
Nov 29, 2022, 4:00:04 PM11/29/22
to
On Tue, Nov 29, 2022 at 11:31:39AM -0800, Ross Vandegrift wrote:
>> Subject: Bug#1025099: plocate: autofs pruning doesn't seem to work
> That subject wasn't too clear- updatedb.plocate does not index the
> remote filesystem, it just triggeres the automount unnecessarily.

I don't think that's possible to avoid; the directory must be stat()-ed
to get to know what type of filesystem it is, and I guess that would trigger
the mount?

I guess it's an interesting question why it even knows how to enter that
directory, if it's not mounted; are you running with ghost on?

/* Steinar */
--
Homepage: https://www.sesse.net/

Ross Vandegrift

unread,
Nov 29, 2022, 6:10:04 PM11/29/22
to
On Tue, Nov 29, 2022 at 09:27:26PM +0100, Steinar H. Gunderson wrote:
> On Tue, Nov 29, 2022 at 11:31:39AM -0800, Ross Vandegrift wrote:
> >> Subject: Bug#1025099: plocate: autofs pruning doesn't seem to work
> > That subject wasn't too clear- updatedb.plocate does not index the
> > remote filesystem, it just triggeres the automount unnecessarily.
>
> I don't think that's possible to avoid; the directory must be stat()-ed
> to get to know what type of filesystem it is, and I guess that would trigger
> the mount?

Interesting - stat -f does the same, and it always returns nfs. Here's
a lame idea: /proc/mounts knows it's actually autofs...

But if there's no non-hacky way to filter out unmounted autofs mounts
early, I'm not sure this is worth fixing. The only impact is delayed
updates when e.g. I'm not home and so the nfs won't mount. Shortening
the mount timeout should help with that.

> I guess it's an interesting question why it even knows how to enter that
> directory, if it's not mounted; are you running with ghost on?

I'm using a systemd automount unit. There's no autofs config or ghost
option, but the effect is similar:
systemd-1 on /mnt/storage type autofs
vanvanmojo.lan:/mnt/storage on /mnt/storage type nfs4

The first is created when the unit is started, the second after
automounting is triggered.

Ross

Steinar H. Gunderson

unread,
Nov 29, 2022, 6:20:04 PM11/29/22
to
On Tue, Nov 29, 2022 at 03:04:01PM -0800, Ross Vandegrift wrote:
> Interesting - stat -f does the same, and it always returns nfs. Here's
> a lame idea: /proc/mounts knows it's actually autofs...

Most of this logic is inherited from mlocate's updatedb, though not all.
It may be fixable or it may not; I'd really need to check. But it really
sounds like one should be able to stat() something without bad things
happening :-) I guess as a workaround, you can ask systemd to sandbox away
the mount for updatedb?

Steinar H. Gunderson

unread,
Jan 6, 2024, 11:40:05 AM1/6/24
to
On Wed, Nov 30, 2022 at 12:09:56AM +0100, Steinar H. Gunderson wrote:
> Most of this logic is inherited from mlocate's updatedb, though not all.
> It may be fixable or it may not; I'd really need to check. But it really
> sounds like one should be able to stat() something without bad things
> happening :-) I guess as a workaround, you can ask systemd to sandbox away
> the mount for updatedb?

Hi,

plocate 1.1.21 doesn't fully fix this, but it gives you a new possible
workaround; if you add the path (/mnt/storage in your case) to PRUNEPATHS,
updatedb won't be entering it.
0 new messages