Clearing /var/tmp on boot

Doug Barton dougb at
Sun Dec 27 23:07:11 UTC 2009

Pegasus Mc Cleaft wrote:
> Hello Current.. 
> 	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.

No, there should not. If you look at hier(7) it says this about
/var/tmp: temporary files that are kept between system reboots

OTOH I do agree that it can tend to get crufty. The better way to
handle things that are there which should definitely be cleaned
routinely is to do it in the scripts for those services. I don't know
about kde or pcscd, but you could add appropriate functionality to the
dbus script very easily, it already has a _prestart method.

Thank you for your interest in making FreeBSD better in any case. If
you have questions about rc.d-specific things you could probably
follow up on freebsd-rc at If you have questions about
individual ports you could follow up on the -ports list.




	Improve the effectiveness of your Internet presence with
	a domain name makeover!

More information about the freebsd-current mailing list