On Sat, Feb 14, 2004 at 08:11:59PM +0100, Hugo (6s-gaming.com) 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. Cheers, Matthew -- Dr Matthew J Seaman MA, D.Phil. 26 The Paddocks Savill Way PGP: http://www.infracaninophile.co.uk/pgpkey Marlow Tel: +44 1628 476614 Bucks., SL7 1TH UK
Description: PGP signature