From jkh@time.cdrom.com  Sat Oct 12 06:56:20 1996
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 <FreeBSD-gnats-submit@freebsd.org>; 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" <jkh@time.cdrom.com>
Reply-To: jkh@time.cdrom.com
To: FreeBSD-gnats-submit@freebsd.org
Subject: locate.updatedb uses /tmp directory.
X-Send-Pr-Version: 3.2

>Number:         1778
>Category:       bin
>Synopsis:       locate.updatedb uses /tmp directory.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Oct 12 07:00:03 PDT 1996
>Closed-Date:    Sat Dec 28 05:29:41 PST 1996
>Last-Modified:  Sat Dec 28 05:30:16 PST 1996
>Originator:     Jordan K. Hubbard
>Release:        FreeBSD 2.2-961004-SNAP i386
>Organization:
FreeBSD Project
>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

>Release-Note:
>Audit-Trail:

From: Wolfram Schneider <wosch@cs.tu-berlin.de>
To: jkh@time.cdrom.com
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: bin/1778: locate.updatedb uses /tmp directory.
Date: Sat, 12 Oct 1996 22:06:39 +0200

 Jordan K. Hubbard writes:
 >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.
 
 It depend how do you configured your system ;-) On most systems
 /var/tmp and /tmp are on the same partition. Some systems use a
 (large) mfs'd /tmp (seems standard on SunOS). 
 
 You can define TMPDIR in /etc/locate.rc (currently, this does not work
 due a missing `export TMPDIR', I will fix this soon)
 
 hier(4)
      /tmp/    temporary files, usually a mfs(8) memory-based filesystem (the
 	      contents of /tmp are usually NOT preserved across a system re-
 	      boot)
 
      /var/tmp/	 temporary files that are kept between system reboots
 
 Wolfram
State-Changed-From-To: open->closed 
State-Changed-By: wosch 
State-Changed-When: Sat Dec 28 05:29:41 PST 1996 
State-Changed-Why:  
set TMPDIR in /etc/locate.rc to a disk with more free space 
if the default /tmp is to small. 

>Unformatted:
