*BSD News Article 85530


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!munnari.OZ.AU!news.ecn.uoknor.edu!feed1.news.erols.com!howland.erols.net!news.mathworks.com!enews.sgi.com!news.sgi.com!news1.best.com!nntp1.best.com!usenet
From: dillon@flea.best.net (Matt Dillon)
Newsgroups: comp.unix.admin,comp.unix.bsd.freebsd.misc
Subject: Re: Limiting /tmp usage
Date: 23 Dec 1996 23:55:00 GMT
Organization: BEST Internet Communications, Inc.
Lines: 39
Message-ID: <59n64k$eos@nntp1.best.com>
References: <59mvr4$283@fridge-nf0.shore.net> <59n1n2$495@fridge-nf0.shore.net> <59n1ta$3dg@fridge-nf0.shore.net>
NNTP-Posting-Host: flea.best.net
Xref: euryale.cc.adfa.oz.au comp.unix.admin:52280 comp.unix.bsd.freebsd.misc:33030

:In article <59n1ta$3dg@fridge-nf0.shore.net>,
:Brian Beaulieu <brianb@shore.net> wrote:
:>Nathan V. Patwardhan (nvp@shore.net) wrote:
:>: Brian Beaulieu (brianb@shore.net) wrote:
:>: : I'm running FreeBSD 2.2-ALPHA with system quotas.  I was wondering how I
:>: : could limit the usage of /tmp by users.  The quota fs is /usr/home, which
:>: : doesn't include /tmp.  Has anyone found a solution for this problem?
:>
:>: Even easier than quotas.  Run a cron that job clears out /tmp (by uid,
:>: perhaps) every x m/h/day, whatever.  Naturally, advise your users of
:>: this.  :)  You could even write the script your cron job executes to
:>: warn (via e-mail, zwrite, etc) users that in x amount of time their
:>: files will be removed from /tmp.
:>
:>Very good suggestion.... Thanks!
:>
:>Brian

    You can turn on quotas for /var/tmp (or /tmp or whatever partition you
    put tmp on), but you generally want to put the actual quota file
    somewhere else so it does not get blown away.  This is how our fstab
    looks:

    /dev/sdxxx  /var/tmp        ufs     rw,userquota=/var/quotas/tmp.user 1 1

    You can then set a quota for each user.  We generally have a 400 MByte
    /var/tmp and set individual quotas to 100 MBytes, plus have a cron job
    that deletes anything over 3 days old.  The reason for the quota is
    basically to prevent a user's runaway process from taking out the
    entire directory, not so much to actually limit him or her... things
    tend to blow up when tmp is full.

    The above is for FreeBSD.  You also want to enable quotas in the
    sysconfig, and the kernel also needs to be compiled with quotas 
    turned on.

					-Matt