Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Re: fork-bomb!

by Eimi Metamorphoumai (Deacon)
on May 01, 2003 at 17:37 UTC ( #254735=note: print w/ replies, xml ) Need Help??

in reply to fork-bomb!

I'm an admin on a few systems that get fork-bombed accidentally a few times a semester (big computers used by students in begining OS courses). There is something you can do if you catch it while it's going on, though, as long as you do a little planning ahead. On those machines I keep about four shells nested.

exec tcsh set prompt="THIS IS YOUR LAST SHELL# " tcsh tcsh tcsh tcsh
(cut and paste into the terminal). Then if I notice the machine is going to Hell, I can "exec top" and "exec pkill -u person" and things like that. Although you can no longer get any new pids, you're quite free to sacrifice shells for that one last desperation command. Just a little tip, in case anyone is interested.

Comment on Re: fork-bomb!
Download Code
Replies are listed 'Best First'.
Re: exec, nested shells
by Xanatax (Scribe) on May 04, 2003 at 19:50 UTC

    ok, _that_ was what is was trying to find info on! couldn't figure out how to burn the pids i still had in shells on things like kill or shutdown. thanks!

    the nested shells is a neat idea also... actually, that's really easy and convenient to setup with 'screen' also. i generally end up with at least eight shells running because of wonton use of windows in screen, so having spare pids is more likely than not.

    i just added an init line to the system to make screen start a half-dozen shells for the root account, so as long as i have a connection to the machine i will have those available for emergencies.

    -- Xanatax.

Re^2: fork-bomb!
by Hue-Bond (Priest) on Sep 11, 2005 at 18:55 UTC

    One could also use psh and exploit the feature of being able to execute Perl code without forking.

    David Serrano

Re: Re: fork-bomb!
by Juerd (Abbot) on May 02, 2003 at 07:49 UTC

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://254735]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (6)
As of 2015-11-28 19:02 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (743 votes), past polls