Process Control

Alan Milford alz at evilalz.net
Tue Mar 22 13:00:25 PST 2005


-----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 at evilalz.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (MingW32)

iD8DBQFCQIdjq48BsFB7OgARAm5JAKDARB5qlommW29kibdG3M9fvGNs4gCgiFbt
hEJfK4ZmzP9UgCTXtQsV8Vo=
=o7lf
-----END PGP SIGNATURE-----


More information about the freebsd-hackers mailing list