Bug 1883734

Summary: mlocate-updatedb.service Doesn't Update All Files
Product: [Fedora] Fedora Reporter: Garry T. Williams <gtwilliams>
Component: mlocateAssignee: Michal Sekletar <msekleta>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 32CC: msekleta, ricardo.arguello, roshan.shariff
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-05-25 16:48:57 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Garry T. Williams 2020-09-30 04:57:02 UTC
Description of problem: mlocate-updatedb.service fails to update database with all files on system.


Version-Release number of selected component (if applicable):
mlocate-0.26-25.fc32.x86_64


How reproducible: Always


Steps to Reproduce:

$ sudo systemctl start mlocate-updatedb.service
$ locate sos-3.9-py3.8.egg-info                
$ sudo updatedb                                
$ locate sos-3.9-py3.8.egg-info
/usr/lib/python3.8/site-packages/sos-3.9-py3.8.egg-info
$

Work-around is /etc/systemd/system/mlocate-updatedb.service:
[Service]
ExecStart=/usr/bin/updatedb

Additional info:

$ mount|grep btrfs
/dev/nvme0n1p2 on / type btrfs (rw,noatime,seclabel,ssd,space_cache,subvolid=258,subvol=/root)
/dev/nvme0n1p2 on /home type btrfs (rw,noatime,seclabel,ssd,space_cache,subvolid=259,subvol=/home)
/dev/nvme0n1p2 on /var/log type btrfs (rw,noatime,seclabel,ssd,space_cache,subvolid=256,subvol=/var_log)
$

mlocate-updatedb.service runs this script (which has odd permissions):

$ sudo cat /usr/libexec/mlocate-run-updatedb
#!/usr/bin/sh

nodevs=$(< /proc/filesystems awk '$1 == "nodev" && $2 != "rootfs" && $2 != "zfs" { print $2 }')
/usr/bin/updatedb -f "$nodevs"
$

$ cat /etc/updatedb.conf
PRUNE_BIND_MOUNTS = "yes"
PRUNEFS = "9p afs anon_inodefs auto autofs bdev binfmt_misc cgroup cifs coda configfs cpuset debugfs devpts ecryptfs exofs fuse fuse.sshfs fusectl gfs gfs2 gpfs hugetlbfs inotifyfs iso9660 jffs2 lustre mqueue ncpfs nfs nfs4 nfsd pipefs proc ramfs rootfs rpc_pipefs securityfs selinuxfs sfs sockfs sysfs tmpfs ubifs udf usbfs ceph fuse.ceph"
PRUNENAMES = ".git .hg .svn .bzr .arch-ids {arch} CVS"
PRUNEPATHS = "/afs /media /mnt /net /sfs /tmp /udev /var/cache/ccache /var/lib/yum/yumdb /var/lib/dnf/yumdb /var/spool/cups /var/spool/squid /var/tmp /var/lib/ceph /BACKUP /home/BACKUP"
$

It looks like /usr/libexec/mlocate-run-updatedb is redundant, given /etc/updatedb.conf.

Comment 1 Fedora Program Management 2021-04-29 16:39:32 UTC
This message is a reminder that Fedora 32 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 32 on 2021-05-25.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '32'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 32 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 2 Roshan Shariff 2021-05-18 21:44:07 UTC
This is probably a duplicate of Bug 1498460, and the workaround given there works.

The issue is the ProtectSystem=true directive in mlocate-updatedb.service.  This
causes systemd to run updatedb in a new mount namespace in which the /usr directory
(among others) is a read-only bind mount.  These directories then get pruned because
PRUNE_BIND_MOUNTS is set to "yes" in /etc/updatedb.conf.

It is possible that this will be fixed by the improved handling of bind mounts
described in Bug 723279#c40, but I haven't tested it.

Comment 3 Ben Cotton 2021-05-25 16:48:57 UTC
Fedora 32 changed to end-of-life (EOL) status on 2021-05-25. Fedora 32 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.