updatedb locate proper usage

Started by lshantz, August 21, 2020, 08:58:57 PM

Previous topic - Next topic
I LOVE the locate utility, but I'm not sure how to do a database update in Opnsense. If I run updatedb as root, it kicks me out saying it is unsafe. If I try to use just a system username it says permissions denied. What is the proper way to rung updatedb to update the database?

You can run this as root:

/usr/libexec/locate.updatedb

It will print a warning, but run anyway.

>>> WARNING
>>> Executing updatedb as root.  This WILL reveal all filenames
>>> on your machine to all login users, which is a security risk.
In theory there is no difference between theory and practice. In practice there is.

Updates depend on the current user rights, try creating them with full administrator rights and making changes through them.

DOH! It went so fast, I thought it didn't run. I'm used to a typical linux system to run for a few minutes. I also found that find / -name <filename> would print results in nanoseconds and a older mechanical hard drive could take many minutes. I guess the fact that the OS is small and the ssd is extremely fast changes things in a big way.