Question & Answer
Question
sort: 0653-650 Cannot locate the temporary directory or /tmp
Cause
The sort error is received because 'sort' tries to create a temporary file which already exists.
'sort' creates temporary files with the name "stm<PID>aaaaa" where <PID> is the PID of the calling process.
Normally 'sort' removes this file when done.
The 'sort' command may be killed before it can remove the temporary file.
If a new 'sort' command is executed from a process with the same PID, the file creation fails with the error...
sort: 0653-650 Cannot locate the temporary directory or /tmp
The only requirement for this error to be hit is a process running 'sort' which has the same PID as a previous process which left over the temporary file.
Answer
The issue is common on servers running Tanium Client.
Tanium client calls the sort utility with certain parameters in one of their scripts. When the utility times out, it is terminated by the client, resulting in residual temporary files in the /tmp or /var/tmp directories. These files include stm<PID>aaaaa. If the PID is then reused for a subsequent sort command, this existing file result in the sort error.
A workaround to resolve this issue with Tanium Client is to change the temporary directory for Tanium by changing its startup in /etc/inittab from
taniumclient:2:once:/usr/bin/startsrc -s taniumclient
to
taniumclient:2:once:/usr/bin/startsrc -e "TMPDIR=/var/tmp2" -s taniumclient
This prevents 'sort' commands being invoked from other processes to be blocked by the temporary files left over by Tanium.
Was this topic helpful?
Document Information
Modified date:
24 March 2022
UID
ibm16566147