LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-02-2006, 05:42 AM   #1
EAD
Member
 
Registered: Mar 2006
Distribution: ARCH linux
Posts: 137

Rep: Reputation: 15
Post too many process


Hii, I have noticed a bug in linux, when I am making a program in C that do
Code:

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.
Tanx
 
Old 05-02-2006, 07:31 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
check out ulimit to see how to restrict users and groups from taking too many resourses.
 
Old 05-02-2006, 07:34 AM   #3
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670
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.
http://www.seifried.org/lasg/users/
You set these limits by editing /etc/security/limits.conf

Last edited by jschiwal; 05-02-2006 at 07:53 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how a father process know which child process send the signal SIGCHLD icoming Programming 10 07-20-2010 08:26 AM
process and child process in java xhi Programming 4 03-28-2006 11:36 AM
Process Table-Process Control Block sarahmencer Linux - General 1 01-09-2006 10:14 PM
Bash Scripting - child process affecting parent process mthaddon Linux - General 1 05-02-2004 02:19 PM
problem with binding process and than execute another process chapa Programming 0 08-27-2003 04:47 AM


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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration