From owner-freebsd-hackers@FreeBSD.ORG Tue Mar 22 21:00:25 2005 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A29A916A4CE for ; Tue, 22 Mar 2005 21:00:25 +0000 (GMT) Received: from smtp1.th.newnet.co.uk (smtp3.th.newnet.co.uk [212.87.64.23]) by mx1.FreeBSD.org (Postfix) with ESMTP id 95BEE43D5A for ; Tue, 22 Mar 2005 21:00:24 +0000 (GMT) (envelope-from alz@evilalz.net) Received: from [80.175.242.30] (alz@pmilford-30.adsl.newnet.co.uk [80.175.242.30]) by smtp1.th.newnet.co.uk (8.13.1/8.13.1) with ESMTP id j2ML0hF2063144 for ; Tue, 22 Mar 2005 21:00:44 GMT (envelope-from alz@evilalz.net) Message-ID: <42408763.7010106@evilalz.net> Date: Tue, 22 Mar 2005 21:00:19 +0000 From: Alan Milford User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-hackers@freebsd.org X-Enigmail-Version: 0.90.1.1 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Process Control X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2005 21:00:25 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, Someone recently asked me the best way to control the number of foreground and background processes a user can run on the system. I had a prod around in a few places and pondered the concept of getting the kernel to limit the max number of processes in login.conf, as sort of sub-limits of maxproc. The best way I could come up with doing this kernel-side is by watching a process' P_CONTROLT flag when a process is created (or tries to fork). If the process had the flag, I assumed it to be foreground, if not, background. If anyone has any other suggestions on how to distinguish fg/bg apart, or on the concept in general, I'd appreciate some feedback! Regards, Alan - -- Alan 'alz' Milford email: alz@evilalz.net -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (MingW32) iD8DBQFCQIdjq48BsFB7OgARAm5JAKDARB5qlommW29kibdG3M9fvGNs4gCgiFbt hEJfK4ZmzP9UgCTXtQsV8Vo= =o7lf -----END PGP SIGNATURE-----