Hi,
I have a machine with a large data storage attached, but it has only 2GB
of /tmp (which I consider enough usually). On this machine weekly
locate.updatedb fails, due to /tmp being full. To fix this I would like
to point locate to a different TMPDIR.
But it seems one can not just set TMPDIR from /etc/locate.rc to point
elsewhere, since command line args in /etc/weekly override
/etc/locate.rc settings.
While it's possible to add a weekly.local to set TMPDIR I believe it
should be better set in the actual configuration file instead of
ignoring locate.rc.
Thus the diff below proposes to remove command line argument to be able
to use /etc/locate.rc instead.
Note, this might break existing setups, where one has set TMPDIR in
/etc/weekly.local to point elsewhere. This might be handled with a
-current upgrade entry?
Comments? OK?
Thanks,
Regards,
Joerg
Index: etc/weekly
===================================================================
RCS file: /cvs/src/etc/weekly,v
retrieving revision 1.29
diff -u -p -r1.29 weekly
--- etc/weekly 30 Dec 2019 16:49:51 -0000 1.29
+++ etc/weekly 8 Feb 2020 23:13:02 -0000
@@ -48,7 +48,7 @@ if [ -f /var/db/locate.database ]; then
if TMP=`mktemp /var/db/locate.database.XXXXXXXXXX`; then
trap 'rm -f $TMP; exit 1' 0 1 15
UPDATEDB="/usr/libexec/locate.updatedb"
- echo "${UPDATEDB} --fcodes=- --tmpdir=${TMPDIR:-/tmp}" | \
+ echo "${UPDATEDB} --fcodes=- | \
nice -5 su -m nobody 1>$TMP
if [ $? -ne 0 ]; then
echo "Rebuilding locate database failed"