LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 08-13-2005, 12:19 AM   #1
edong23
Member
 
Registered: Apr 2005
Distribution: Slackware
Posts: 350

Rep: Reputation: 30
forkbomb fix slackware?


ok.... i use slackware, but i always readup on the gentoo newsletter, just cause it is good reading. now, the thing this week that was fun was the forkbomb test. putting in ){ :|:& };: into a term as user and crashing my system. that is all cool, but the fix is to, as root, ulimit -u 30. or however many. but when i run that and i check with ulimit -a i see it has changed to 30. but then i run the script as user and bam, teh system goes down. the processes shoot up over 3000 and boom. y wont this work on slackware 10.1.... ?
 
Old 08-13-2005, 12:44 AM   #2
SlackerLX
Senior Member
 
Registered: Dec 2004
Location: Herzliyya, Israel
Distribution: SuSE 10.1; Testing Distros
Posts: 1,832

Rep: Reputation: 47
Might I remind that Slack is the closest to FreeBSD. Probably that's the reason
 
Old 08-13-2005, 12:59 AM   #3
jong357
Senior Member
 
Registered: May 2003
Location: Columbus, OH
Distribution: DIYSlackware
Posts: 1,914

Rep: Reputation: 52
http://www.linuxquestions.org/questi...limit+forkbomb
 
Old 08-13-2005, 02:06 AM   #4
edong23
Member
 
Registered: Apr 2005
Distribution: Slackware
Posts: 350

Original Poster
Rep: Reputation: 30
slackerLX says that slack is close to freebsd, but freebsd isnt effected. my box is. the link left by jong357 led me to the same thing that i tried, in a terminal as root i issue:

ulimit -u 30

to cut the number of processes a user can run to 30. then i check it with ulimit -a and it confirms that max processes per user is 30. but when i issue the command, my system is still taken down.

i opend a term and ran top then another term and ran the forkbomb, and i saw the processes skyrocket. in the thousands, then lockup. the command is supposed to help, but doesnt.,.. i cant figure out y...
 
Old 08-13-2005, 04:17 AM   #5
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
Are you sure you execute the fork bomb at the same shell you executed ulimit -u 30 ?
 
Old 08-13-2005, 08:55 AM   #6
edong23
Member
 
Registered: Apr 2005
Distribution: Slackware
Posts: 350

Original Poster
Rep: Reputation: 30
well yeah, cause i didnt have x running the first time. just on the default console..
 
Old 08-13-2005, 10:26 AM   #7
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
Could you try as normal user:
Code:
ulimit -u 30
:(){ :|:& };:
 
Old 08-13-2005, 10:35 AM   #8
edong23
Member
 
Registered: Apr 2005
Distribution: Slackware
Posts: 350

Original Poster
Rep: Reputation: 30
ahh... that worked, but y didnt it work when i did it as root? and will that work on all users of my system if i only put it in on my login?
 
Old 08-13-2005, 10:43 AM   #9
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
You could put ulimit -u 30 in /etc/profile so the setting is applied to
all users but 30 is very limited in my opinion

(I am now under KDE and top shows me that 100 processes are currently running)

[edit]
100 processes are being used but 2 are running and 98 sleeping
anyway I need at least 150/200 processes IHMO

Last edited by keefaz; 08-13-2005 at 10:47 AM.
 
Old 08-13-2005, 11:49 AM   #10
jong357
Senior Member
 
Registered: May 2003
Location: Columbus, OH
Distribution: DIYSlackware
Posts: 1,914

Rep: Reputation: 52
Quote:
Originally posted by edong23
ahh... that worked, but y didnt it work when i did it as root? and will that work on all users of my system if i only put it in on my login?
That's why I posted the link instead of repeating what was said on the second page of that thread. That seemed to be the solution... Putting it in /etc/profile or each users ~/.bash_profile implied that ulimit would get set for everyone as soon as they logged in to their shell.
 
Old 08-13-2005, 05:43 PM   #11
edong23
Member
 
Registered: Apr 2005
Distribution: Slackware
Posts: 350

Original Poster
Rep: Reputation: 30
thats y i dont use kde... i have enlightenment and i am running 35 processes right now with 1 user. 3 running and the rest sleeping. so, yeah 30 is pretty limited, i was just giving it a shot. i only see over 100 procs when i open a kde program, like k3b. i just dont like the slow speed of kde is all. it effects everything. with kde, glxgears gives me 1000 fps on the default res.. but with enlightenment i get 1700 fps with default res.. with fluxbox it is even faster, but i like some eye candy. anyway, i will probably use more like 200, cuase i do alot of video and dvd stuff. i never see more than 200, ever so. i might make it 300 just in case.. ill try editing the profile file, can anyone give me an example of what part to edit... i have never messed with the profile file. thanks for the link. i must have missed the solution somewhere.
 
Old 08-13-2005, 06:00 PM   #12
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
Just add ulimit -u 300 (for example) at the end of /etc/profile,
say after the last line to be sure
 
Old 08-13-2005, 06:19 PM   #13
egag
Senior Member
 
Registered: Jul 2004
Location: Netherlands
Distribution: Slackware
Posts: 2,721

Rep: Reputation: 53
the forkbomb " :(){ :|:& };: " didn't seem to work here ?
so i did ":(){ :& };: "

now my pc is still as usable as allways, but the proc is running at 100 % .
i tried " killall : " as root but it won't stop.
how can i kill it ?

egag
 
Old 08-13-2005, 06:49 PM   #14
titopoquito
Senior Member
 
Registered: Jul 2004
Location: Lower Rhine region, Germany
Distribution: Slackware64 14.2 and current, SlackwareARM current
Posts: 1,646

Rep: Reputation: 147Reputation: 147
Hm, does "killall -9 name-of-app" make a difference?
 
Old 08-13-2005, 07:23 PM   #15
egag
Senior Member
 
Registered: Jul 2004
Location: Netherlands
Distribution: Slackware
Posts: 2,721

Rep: Reputation: 53
i got it stopped now.
i saw a "bash" in the sysguard with an upgoing pid.

so i typed " kill <pid+100>" and repeated " enter-arrow_up " as fast as i could.
then i had luck.
i'm not gonna start it now again, but i'll try tomorrow.
there should be a decent way to stop it....

egag
 
  


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
all attempts to fix the problem failed... can someone help me fix partition space? foreverdita Linux - Enterprise 2 05-11-2005 09:02 AM
need to fix system clock on slackware 10.0 salviadud Slackware 3 03-02-2005 01:50 PM
reiserfsck --fix-fixable -> --fix-fixable ignored - why? BrianK Linux - Software 1 01-07-2005 08:45 PM
How to fix "hissing sound" problem in Slackware 9.1? linuxlah Linux - General 5 11-28-2003 02:03 AM
How do i fix this? glitch Linux - Newbie 22 09-21-2002 08:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 04:59 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