Original Message:
Sent: Wed March 29, 2023 03:52 AM
From: C- -T
Subject: updatedb & sort filling up /tmp
i guess this is what the linux guys are using...
https://github.com/msekletar/mlocate/blob/master/src/updatedb.c
seems that this is not generating any temporary files unlike the aix script...could not find something related in the code, just direct db creation.
------------------------------
I regret starting this entire conversation
Original Message:
Sent: Wed March 29, 2023 03:46 AM
From: C- -T
Subject: updatedb & sort filling up /tmp
i must confess i never paid much attention to this locate stuff...but the first obvious difference between the updatedb command between linux and aix is that on linux its not a shell script but a binary. just checked on my ubuntu notbook.
so there might be some hidden "treasures" somewhere,
------------------------------
I regret starting this entire conversation
Original Message:
Sent: Wed March 29, 2023 03:19 AM
From: Henrik Morsing
Subject: updatedb & sort filling up /tmp
Let's just rewind a bit here.
My issue is:
"I have used updatedb for 25 years on Linux and have never had this problem. What is the difference to AIX?"
I checked the disk space graphs on my home server (Linux (sadly)) running updatedb every night, and they are completely flat.
This is the first place I have ever worked where locate on AIX is standard on our builds, which is cool, but there is now talk about scrapping it because of frequent alerting.
Move it to a filesystem with more space? We don't just have three servers. We need a standard place for this, /tmp or /var/tmp would be correct, and adding space to lots of servers because of this issue will not go down well.
Regards,
Henrik Morsing
------------------------------
Henrik Morsing
Original Message:
Sent: Tue March 28, 2023 11:25 AM
From: Stephen Ulmer
Subject: updatedb & sort filling up /tmp
Note that this bit of shell won't change the value of TMPDIR if it is already set.
Is TMPDIR already set, or is there a place you could set it to (temporarily) with enough space?
--
Stephen Ulmer
Sent from a mobile device; please excuse auto-correct silliness.
Original Message:
Sent: 3/28/2023 10:31:00 AM
From: Henrik Morsing
Subject: RE: updatedb & sort filling up /tmp
It actually does this:
# Directory to hold intermediate files.
if test -d /var/tmp; then
: ${TMPDIR=/var/tmp}
elif test -d /usr/tmp; then
: ${TMPDIR=/usr/tmp}
else
: ${TMPDIR=/tmp}
fi
export TMPDIR
I have just tested both, and it makes no difference to filling up the filesystem. I know GNU sort is highly customisable, but it is a compromise between disk space, memory/processor and time.
Regards,
Henrik Morsing
------------------------------
Henrik Morsing
Original Message:
Sent: Tue March 28, 2023 10:17 AM
From: C- -T
Subject: updatedb & sort filling up /tmp
concerning your /tmp fillup troubles...updatedb runs mktemp somewhere, which uses whatever $TMPDIR is currently set to. maybe you should run
a cron job to cleanup /tmp regulary.
------------------------------
I regret starting this entire conversation
Original Message:
Sent: Tue March 28, 2023 10:14 AM
From: Henrik Morsing
Subject: updatedb & sort filling up /tmp
Thank-you for that, I hadn't even realised updatedb was a shell script, I was looking at the C source code on GitHub! Not sure what I have been looking at now.
The script on my system says:
sort="/usr/bin/sort"
throughout, not sure why it is different. I can try changing it.
Regards,
Henrik Morsing
------------------------------
Henrik Morsing
Original Message:
Sent: Tue March 28, 2023 10:07 AM
From: C- -T
Subject: updatedb & sort filling up /tmp
/opt/freeware/bin/updatedb from findutils rpm checks for the sort binary from the aix toolbox...not sure whats your problem.
excerpt from updatedb shell script:
if truethen sort="/opt/freeware/bin/sort -z" print_option="-print0" frcode_options="$frcode_options -0"else sort="/opt/freeware/bin/sort" print_option="-print"fi
------------------------------
I regret starting this entire conversation
Original Message:
Sent: Tue March 28, 2023 03:25 AM
From: Henrik Morsing
Subject: updatedb & sort filling up /tmp
Good morning,
We have a problem with updatedb, when running sort, fills up /tmp/ with stm-files.
I realised that updatedb on AIX, due to the search path, runs AIX' sort instead of GNU sort, so tried to run it using GNU sort instead. Helped a little bit but didn't go away.
Why have I not come across this problem in 25 years of Linux use? The man page for sort on Linux says it puts files in /tmp/ as well, what's the difference?
Does anyone here run updatedb on AIX? Do you have the same issue? What's the fix?
Regards,
Henrik Morsing
------------------------------
Henrik Morsing
------------------------------