On Thu, Dec 09, 2010 at 10:14:55AM +0000, Athanasius wrote:
>   In general I think it's a good idea to set TMP and TMPDIR to ~/tmp
> anyway.  If you have a GOOD reason to want to have such on actual /tmp
> (faster local disk instead of NFS disk?) then I'd recommend some shell
> startup scripting to attempt to make /tmp/<user>/, and set TMPDIR to
> that, bitching if it can't ensure it exists, is owned by you, and chmod
> 700.

  Aha, here's my example, I Was looking in the wrong host's ~/.bashrc.
Yes it's generating ${HOME}/tmp in this example, and is a bit overkill
for that, but I copied it from similar for /tmp/${USER}.  Adjust to
taste.

        ## Try to guarantee a 'good' /tmp directory for me
        MYTMP=${HOME}/tmp
        if [ ! -d ${MYTMP} ];
        then
                        if [ -e ${MYTMP} ];
                        then
                                rm -f ${MYTMP} 2> /dev/null
                        fi
                        mkdir ${MYTMP} 2> /dev/null
        fi
        if [ ! -O ${MYTMP} ];
        then
                 echo "Warning, someone else owns ${MYTMP} !"
                 if [ ! -d ${MYTMP} ];
                 then
                        echo "And it isn't a directory either."
                 fi
                 mail -s "/tmp problem" athan << END
Problem with ${MYTMP}
END
                export TMPDIR=/tmp
        else
                chmod 700 ${MYTMP}
                export TMPDIR=${MYTMP}
                export LYNX_TEMP_SPACE=${MYTMP}
        fi


-- 
- Athanasius = Athanasius(at)miggy.org / http://www.miggy.org/
                  Finger athan(at)fysh.org for PGP key
           "And it's me who is my enemy. Me who beats me up.
Me who makes the monsters. Me who strips my confidence." Paula Cole - ME

Attachment: signature.asc
Description: Digital signature

Reply via email to