[arch-projects] [initscripts][RFC] managing /tmp
teg at jklm.no
Wed May 18 12:34:50 EDT 2011
Thanks to all of you who answered my many previous RFC's, I will
follow up on them with code soon :-)
In the last initscripts release I inedvertently introduced a bug where
/tmp is not cleared on boot if it is mounted on a non-tmpfs drive (it
was only cleared if it lived on the root partition). This lead to a
long discussion in the bug report about possible use-cases for /tmp.
Among other things it was requested that we should stop clearing /tmp
or make it configurable. As always, I'm opposed to adding
configuration options just for the sake of it, so I propose something
First of all, this is what I took away from the discussion:
1) /tmp should always be mounted as tmpfs (there are some really
obscure scenarios when it should not be (if you have individual files
larger than 256GB on it))
2) if /tmp is not mounted as tmpfs it should always be cleared at boot
That said, some users disagree, and want to /tmp to be preserved on
reboot. Usually I would deny such a request, but I figured it would
actually simplify things, so why not. This is my proposal:
1) We advice users to mount /tmp as tmpfs (possibly with the proviso
that the partition they would normally have used for /tmp is turned
into swap space, and the size option of /tmp is set to the size of the
old partition), this could be added to the standard fstab if we wish.
2) We never touch /tmp at boot. This makes no difference if the users
follow our advice.
3) If the user wants to mount /tmp as a different fs, we advice them
to put "rm -rf /tmp/* /tmp/.*" in rc.local, or manage /tmp in any
other way they want (e.g. by using the tmpwatch package).
What do you think?
More information about the arch-projects