From owner-freebsd-current@FreeBSD.ORG Sun Dec 27 23:22:13 2009 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E397310656BC for ; Sun, 27 Dec 2009 23:22:13 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay04.stack.nl [IPv6:2001:610:1108:5010::107]) by mx1.freebsd.org (Postfix) with ESMTP id AD96E8FC1C for ; Sun, 27 Dec 2009 23:22:13 +0000 (UTC) Received: from toad.stack.nl (toad.stack.nl [IPv6:2001:610:1108:5010::135]) by mx1.stack.nl (Postfix) with ESMTP id 925971DD652; Mon, 28 Dec 2009 00:22:12 +0100 (CET) Received: by toad.stack.nl (Postfix, from userid 1677) id 788D273FA1; Mon, 28 Dec 2009 00:22:12 +0100 (CET) Date: Mon, 28 Dec 2009 00:22:12 +0100 From: Jilles Tjoelker To: Pegasus Mc Cleaft Message-ID: <20091227232212.GA18893@stack.nl> References: <200912272256.13436.ken@mthelicon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200912272256.13436.ken@mthelicon.com> User-Agent: Mutt/1.5.18 (2008-05-17) Cc: FreeBSD current mailing list Subject: Re: Clearing /var/tmp on boot X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Dec 2009 23:22:14 -0000 On Sun, Dec 27, 2009 at 10:56:13PM +0000, Pegasus Mc Cleaft wrote: > While checking over my system (9-CURRENT AMD64) I was a bit > surprised to find tons of old files that were hanging around in my > /var/tmp that were never deleted/cleaned out. Most of the offenders > were dbus, KDE and PCSCD files. To be honest, I never really checked > the /var/tmp directory as I normally use the /tmp for generic stuff > (unpacking archives, etc). I was wondering if there should be a > startup rc script that cleans this directory as well. I copied and > modified the existing /etc/rc.d/cleartmp (now > /usr/local/etc/rc.d/clearvartmp) to do this job and would be > interested in knowing if this is a good idea or if there are any ill > effects that I didn't anticipate by doing this. > Should the /var/tmp directory be cleaned on bootup? To me, it > looked like it should as many of the files in the KDE directory were > partial download files many months old. Like all temporary directories, it is a good idea to clean stale files from /var/tmp, but hier(7) explicitly says that /var/tmp is not cleared on reboot. In particular, nvi's recovery system puts files in /var/tmp/vi.recover/ and assumes they will not be deleted by a reboot (see /etc/rc.d/virecover). What could be done is deleting, on reboot, all files older than some threshold, e.g. one week. Another alternative is to enable /etc/periodic/daily/110.clean-tmps. That one is a bit overzealous though, also deleting sockets that are still in use. > I have included the script I used in this email, but would like > to point out that I am not the author of the original script, I mearly > modified the existing one to do as I wanted. The attachment seems missing. -- Jilles Tjoelker