background process limit?

Matthew Seaman m.seaman at
Sat Feb 14 12:54:28 PST 2004

On Sat, Feb 14, 2004 at 08:11:59PM +0100, Hugo ( wrote:

> Is there a way to limit background processes ? I need to separate these
> from foreground processes, but can't find a way to. Any ideas?

There isn't really any way of distinguishing foreground and background
processes apart from typing 'jobs' at the shell prompt.  'Foreground'
and 'background' processes are concepts specific to your shell -- as
far as the system is concerned, a process is a process, and it doesn't
care if that's the process currently accepting interactive input from
the tty or not.  

You can use the limits(1) command or the settings in /etc/login.conf
to limit the total number of processes are user can run, which
effectively prevents them from spawning too many background processes.
You can set the 'maxfiles' limit quite high if the intent is to
prevent your users from forkbombing your machine -- that will avoid
interfereing with normal usage.  If the problem is that your system is
running out of resources to cope with the number of users and
processes on it, then you're probably better off looking at each
users' datasize, filesize, cputime, memoryuse and/or virtualmem limits
as well.  However, don't be too draconian or your users will become
quite irate as their legitimate processes start to get killed off.



Dr Matthew J Seaman MA, D.Phil.                       26 The Paddocks
                                                      Savill Way
PGP:         Marlow
Tel: +44 1628 476614                                  Bucks., SL7 1TH UK
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url :

More information about the freebsd-questions mailing list