Hey geekos! I’m having trouble with mlocate. Specifically, after each reboot, locate … will never return results, unless I run updatedb. I’m on a fresh install of Leap 16.0, where I recently ran zypper install mlocate.
Now, my understanding is that the database is automatically recreated on every system reboot, making it impossible to maintain a persistent database. Any updates to the database are lost at the next reboot. After I run updatedb, I can check the state with
ls -la /var/lib/mlocate/mlocate.db
which returns
-rw-r--r--. 1 root root <some normal file size> <approx. current date, time> mlocate.db
After a reboot, the same command however returns
-rw-r--r--. 1 nobody nobody <a small size> <date, time of the boot> mlocate.db
The timestamp changes to the reboot time, indicating the database was regenerated. The file is also owned by the nobody user instead of root . (BTW: None of my users is “nobody”
).
It seems that the mlocate.timer systemd unit is automatically running updatedb on every boot:
systemctl list-timers --all | grep mlocate
returns
<tomorrow> 00:00:00 … <last boot time> … mlocate.timer mlocate.service
I think the mlocate database should persist across reboots. Users should be able to maintain and update the database without it being automatically regenerated on every boot.
Does anybody else see this issue?
I assume it can be mitigated with
sudo systemctl disable mlocate.timer
sudo systemctl stop mlocate.timer
But maybe this should be classified as unwanted behavior, and I should file a report in Bugzilla?