updatedb can not create temporary file for a custom database file
3
votes
2
answers
690
views
I am trying to create a custom
mlocate
db for my home directory. When running the updatedb
it complains about inability to open a temporary file.
55;~/>uname -a
Linux yoga 4.12.14-lp151.28.59-default #1 SMP Wed Aug 5 10:58:34 UTC 2020 (337e42e) x86_64 x86_64 x86_64 GNU/Linux
56;~/>updatedb --version
updatedb (mlocate) 0.26
...
57;~/>updatedb -l 0 -o ~/.home-mlocate.db -U ~/
updatedb: can not open a temporary file for `/home//.home-mlocate.db'
Prepending updatedb
with sudo
or running as root does not change the outcome. Running simply sudo updatedb
without any arguments succeeds.
More generally unless the database is the default one updatedb
can not create temporary file:
yoga:~ # /usr/bin/whoami
root
yoga:~ # /usr/bin/updatedb ; echo $?
0
yoga:~ # /usr/bin/updatedb -o /var/lib/mlocate/mlocate.db ; echo $?
0
yoga:~ # /usr/bin/updatedb -o /var/lib/mlocate/custom-mlocate.db ; echo $?
/usr/bin/updatedb: can not open a temporary file for `/var/lib/mlocate/custom-mlocate.db'
1
yoga:~ # /usr/bin/strace /usr/bin/updatedb -o /var/lib/mlocate/custom-mlocate.db 2>&1 1>\dev\null | grep "openat.*custom-mlocate.db"
openat(AT_FDCWD, "/var/lib/mlocate/custom-mlocate.db", O_RDWR) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/var/lib/mlocate/custom-mlocate.db.6JiH9O", O_RDWR|O_CREAT|O_EXCL, 0600) = -1 EACCES (Permission denied)
yoga:~ #
My operating system is openSUSE Leap 15.1 and my /home
directory is on an ext4 file system.
What is the problem and how it is to be resolved?
Asked by R. Matveev
(171 rep)
Aug 31, 2020, 09:41 AM
Last activity: Jul 15, 2021, 10:08 AM
Last activity: Jul 15, 2021, 10:08 AM