From owner-freebsd-bugs Sat Oct 12 07:00:06 1996 Return-Path: owner-bugs Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id HAA01281 for bugs-outgoing; Sat, 12 Oct 1996 07:00:06 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id HAA01267; Sat, 12 Oct 1996 07:00:04 -0700 (PDT) Resent-Date: Sat, 12 Oct 1996 07:00:04 -0700 (PDT) Resent-Message-Id: <199610121400.HAA01267@freefall.freebsd.org> Resent-From: gnats (GNATS Management) Resent-To: freebsd-bugs Resent-Reply-To: FreeBSD-gnats@freefall.FreeBSD.org, jkh@time.cdrom.com Received: from time.cdrom.com (time.cdrom.com [204.216.27.226]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id GAA00947 for ; Sat, 12 Oct 1996 06:56:19 -0700 (PDT) Received: (from jkh@localhost) by time.cdrom.com (8.7.6/8.6.9) id GAA09482; Sat, 12 Oct 1996 06:56:19 -0700 (PDT) Message-Id: <199610121356.GAA09482@time.cdrom.com> Date: Sat, 12 Oct 1996 06:56:19 -0700 (PDT) From: "Jordan K. Hubbard" Reply-To: jkh@time.cdrom.com To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: bin/1778: locate.updatedb uses /tmp directory. Sender: owner-bugs@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >Number: 1778 >Category: bin >Synopsis: locate.updatedb uses /tmp directory. >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Oct 12 07:00:03 PDT 1996 >Last-Modified: >Originator: Jordan K. Hubbard >Organization: FreeBSD Project >Release: FreeBSD 2.2-961004-SNAP i386 >Environment: A root directory with only 10MB or so free on it. >Description: I've been noticing that my locate database updated have been failing lately, and finally bothered to trace through the log file and notice that it was dying on a /: file system full. It seems to me that TMPDIR should default to /var/tmp for such a temp-space hungry application as this, rather than /tmp. >How-To-Repeat: Have a close-to-full root filesystem and wait for 2am. :-) >Fix: Index: locate/concatdb.sh =================================================================== RCS file: /home/ncvs/src/usr.bin/locate/locate/concatdb.sh,v retrieving revision 1.2 diff -u -r1.2 concatdb.sh --- concatdb.sh 1996/08/27 20:04:24 1.2 +++ concatdb.sh 1996/10/12 13:54:01 @@ -39,7 +39,8 @@ umask 077 # protect temp files -: ${TMPDIR=/tmp}; export TMPDIR; +# Try /var/tmp first and let it fall back to /tmp if not found. +: ${TMPDIR=/var/tmp}; export TMPDIR; if test X"$TMPDIR" = X -o ! -d "$TMPDIR"; then TMPDIR=/tmp; export TMPDIR fi Index: locate/mklocatedb.sh =================================================================== RCS file: /home/ncvs/src/usr.bin/locate/locate/mklocatedb.sh,v retrieving revision 1.2 diff -u -r1.2 mklocatedb.sh --- mklocatedb.sh 1996/08/27 20:04:25 1.2 +++ mklocatedb.sh 1996/10/12 13:54:23 @@ -38,7 +38,8 @@ umask 077 # protect temp files -: ${TMPDIR=/tmp}; export TMPDIR; +# Try /var/tmp first and let it fall back to /tmp if not found. +: ${TMPDIR=/var/tmp}; export TMPDIR; if test X"$TMPDIR" = X -o ! -d "$TMPDIR"; then TMPDIR=/tmp; export TMPDIR fi Index: locate/updatedb.sh =================================================================== RCS file: /home/ncvs/src/usr.bin/locate/locate/updatedb.sh,v retrieving revision 1.4 diff -u -r1.4 updatedb.sh --- updatedb.sh 1996/08/27 20:04:28 1.4 +++ updatedb.sh 1996/10/12 13:55:00 @@ -68,7 +68,7 @@ done;; esac -tmp=${TMPDIR=/tmp}/_updatedb$$ +tmp=${TMPDIR=/var/tmp}/_updatedb$$ trap 'rm -f $tmp' 0 1 2 3 5 10 15 # search locally >Audit-Trail: >Unformatted: