LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 09-01-2010, 06:29 AM   #16
Aquarius_Girl
Senior Member
 
Registered: Dec 2008
Posts: 4,731

Original Poster
Blog Entries: 29

Rep: Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940

Quote:
Originally Posted by druuna View Post
Hi,

This tool (ulimit) will not necessarily stop the initial process, it will limit the use of resource for a user or a specific terminal.

The message you get (also mentioned in the link I gave) tells you that a limit is reached. And even though that specific terminal might become unresponsive, other terminals and the machine itself are not compromised by, in this example, a bash fork bomb.

You could compare it with making a building fire proof: You can have a blazing fire in one room (which is destroyed, most of the time) but the adjacent rooms and building itself survive.
Thanks for the effort !

This time I ran :
Code:
anisha@linux-uitj:~> su
Password:
linux-uitj:/home/anisha # ulimit -u 15
linux-uitj:/home/anisha #
I again compiled the project without modifying "Libtool".
Then I did ps -el which showed the same *very lenghty* output !!

Why ??

When I set ulimit to 15 then does it not mean that hanging libtool can create only 15 processes ?

Not only that terminal but whole system started getting very slow !!

Last edited by Aquarius_Girl; 09-01-2010 at 06:33 AM.
 
Old 09-01-2010, 06:44 AM   #17
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

Count yourself lucky that you can still do something!

Although I had a feeling this would happen, I did become root (full login: su -), executed ulimit -u 30 and executed the fork bomb. Result: End of story within a second. I needed a hard reset to reboot my machine (don't you just love ext3 and the journal recovery it would have taken a while with ext2 and fsck on 12 partitions..... )

Root, as you should know, is a special user and should not be used for day to day tasks. Maybe ulimit can be set up for root, but restricting a user that is unrestricted doesn't sound/feel good.

Hope this helps.
 
Old 09-01-2010, 07:16 AM   #18
Aquarius_Girl
Senior Member
 
Registered: Dec 2008
Posts: 4,731

Original Poster
Blog Entries: 29

Rep: Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940
I am not still understanding the purpose of "ulimit" !

I ran it without root too but still the system was getting *slow* though *slowly* !

1. When it can't prevent other processes from "hanging/getting slow" then what's the use ?
2. Should the KDevelop be also launched from the same shell to see some effects of ulimit ?
3. Does "ulimit" has to started every time we restart computer ? Can't we set and fix the value somewhere ?
 
Old 09-01-2010, 07:46 AM   #19
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

Quote:
I am not still understanding the purpose of "ulimit" !
It is there to protect other users and the machine itself, it is _not_ necessarily meant to stop processes. Also see my previous reply:

- This tool (ulimit) will not necessarily stop the initial process, it will limit the use of resource for a user or a specific terminal.
And:
- I'm not sure, but I would understand if the following scenario where true: Process A forks a sub-process B. Process B starts forking multiple processes (loop, intentional or not). Ulimit kills Process B and its children when reaching the limit, but process A remains.

Quote:
3. Does "ulimit" has to started every time we restart computer ? Can't we set and fix the value somewhere ?
Yes, but you do not have to do this yourself.

I haven't used suse in a long time, but I do believe this is the place to check: /var/adm/fillup-templates/sysconfig.ulimit also have a look here: ulimit - Set per-process limits (ulimits) [openSuse].

Hope this helps.

Last edited by druuna; 09-01-2010 at 08:52 AM. Reason: Fixed a typo
 
  


Reply



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
LXer: A Tale of Two Forks LXer Syndicated Linux News 0 11-26-2008 05:41 AM
What is the more easier way to check the pid and kill the pid cmx08 Linux - General 5 09-09-2008 10:57 PM
kill pid.... won't work with 'pid' variable given.. sachitha Programming 6 03-06-2006 07:48 PM
/var/run/[XXX].pid - Tcl pid code liguorir Linux - Software 1 05-20-2004 10:32 PM
ERROR: Couldn't write pid to pid file lawrencegoodman Linux - Newbie 2 02-13-2004 08:05 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:12 PM.

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
Open Source Consulting | Domain Registration