Why doesn't FreeBSD clear /tmp on bootup?

Christoph Schug chris+freebsd-questions at schug.net
Thu May 3 16:53:13 UTC 2007


On Thu, May 03, 2007, sac wrote:

> I've seen OpenBSD and some other variants of Unix clearing /tmp on
> bootup. But FreeBSD doesn't seem to do so.

This one is configurable in /etc/rc.conf, take a look at
/etc/defaults/rc.conf for default settings and explanations:

| clear_tmp_enable="NO"   # Clear /tmp at startup.
| clear_tmp_X="YES"       # Clear and recreate X11-related directories in /tmp

OTOH you can configure /tmp/ as memory file system (which is clear with
every reboot cause of its nature) using settings like

| tmpmfs="YES"
| tmpsize="128m"
| tmpmfs_flags="-S"

in /etc/rc.conf (in this example 128 MB of /tmp without soft-updates).

-cs



More information about the freebsd-questions mailing list