-   Linux - Newbie (
-   -   too many process (

EAD 05-02-2006 04:42 AM

too many process
Hii, I have noticed a bug in linux, when I am making a program in C that do

while(true) fork();

and then run it on other host, the kernel get stuck after a while.
Is there a way to protect against it?
and sencond, after the user have disconncet, Can I kill all those process?
and third, How can I limit the cpu use of each user so no on will make the cpu too busy?
I need the answers as a "root" and also as a reguler user what to do.

acid_kewpie 05-02-2006 06:31 AM

check out ulimit to see how to restrict users and groups from taking too many resourses.

jschiwal 05-02-2006 06:34 AM

Added pam_limits
Look in the bashref manual.
Ulimit can limit the several resources including the maximum number of processes that a single user can use.

If the host uses pam, there is a pam_limits module that enforces user limits.
You set these limits by editing /etc/security/limits.conf

All times are GMT -5. The time now is 09:09 AM.