[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: /tmp as tmpfs and consequence for imaging software



On Sun, Nov 13, 2011 at 11:04:55AM +0000, Lars Wirzenius wrote:
> On Sun, Nov 13, 2011 at 06:30:27PM +0800, Thomas Goirand wrote:
> > Agreed. Anyway, I'd be happy to have, by policy, some hard limits
> > We can discuss of a tolerable size, like 100M? Anyway, anything
> > bigger than 512 MB is obviously abusing /tmp, IMHO. But if we're
> > to have /tmp using tmpfs by default, it becomes really important
> > to have such policy.
> 
> The proper policy, IMHO, is that a) all software that uses temporary
> files should obey TMPDIR if set (and fall back on /tmp if not)
> and b) all software must deal with out-of-disk-space errors in a 
> sensible way (where the exact details may depend on the software).

Agreed.  Software which has unusually large space requirements
should, I think, make use of existing facilities such as statvfs(2)
to check that sufficient free space exists prior to attempting to
use several GiB.  While not a guarantee of success, this would
permit such applications to display a suitably informative error
message, perhaps with instructions for rectifying the problem,
rather than inconveniently failing later with ENOSPC.

> It is then a sysadmin decision to setup /tmp or TMPDIR properly
> so there's enough free space for temporary files for the software
> they use. Debian should provide sensible defaults, but it's not
> possible to pick defaults that are optimal for everyone, in
> this situation. Given that MySQL, scientific software, and such
> systems are mostly run on systems that have sysadmins, and desktops
> are run by people who do not, it's sensible to favor the desktop
> case by default.

As mentioned in the original report, one of the "desktop" use cases
is burning DVD images, which may require over 4 GiB in temporary
space.  Whether /tmp is suitable for such a purpose is IMO debatable.

Currently, the size limits for /tmp and other temporary filesystems
are set in /etc/default/tmpfs.  It would I think be relatively
simple for the debian-installer to change these default values
according to the general usage of the system.  This could also
influence the automated partitioner should it be desirable to
have a disc-backed /tmp.  I would certainly like for the
partitioner to permit changing of the mount defaults, including
size limits, for the various tmpfses including /tmp, when
generating the initial /etc/fstab.  I lack the d-i knowledge to
add support for tmpfs though.


Regards,
Roger

-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux             http://people.debian.org/~rleigh/
 `. `'   Printing on GNU/Linux?       http://gutenprint.sourceforge.net/
   `-    GPG Public Key: 0x25BFB848   Please GPG sign your mail.


Reply to: