🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.folklore.computers
Article #298

Re: My true cookie story

#298
From: d... William David Haas
Date: Tue, 26 Dec 1989 08:51
68 lines
3917 bytes
In article <70...@shlump.nac.dec.com> pa...@star.enet.dec.com () writes:
This will be funniest to the UNIX types out there.

In my novice days of shell scripts I played around to see what I could learn.
I wrote the following script

	/usr/games/fortune $1
	echo "------------------------"
	bin/fortune $1

I would then execute this with the line 

	fortune -o | more
or
	fortune -a | more

This would run the fortune cookie program repeatidly.  What I didn't realize 
is that the each script would invoke a new one and wait for it to finish.
Well, months later I had forgotten about this script and typed 

	fortune &

This ran my script instead of the actual program and I started getting the
fortunes on my screen.  I couldn't kill the job because its job number had
gone off the screen and I couldn't figure out the job number because when
I asked for the list of my running jobs the fortunes would scroll that.  So 
I typed 
	zapme

Zapme is a script which does the following:
	get list of user's processes
	kill each one (except itself)
	loop until no jobs are left
	quit

Well, it kill one of the fortunes and then killed my login.  When I logged 
back in I noticed the system was really ssslloooowwwww.  I checked and I had
about a fortune running and the zapme process..... and then my connection
died.  I logged in again and I had about a fortunes running and my login
died.  Thats when it dawned on me.

I had typed '&' as the argument to fortune.  This made it run in the 
the background.  When my original connection had died all output was redirected
to /dev/null (?????) and so each fortune was running faster.  When it was done
it would execture a new fortune.  Meanwhile zapme was getting a list of my jobs
and killing them but before it had a chance to get the list a new fortune with
a new job number would be started.  Zapme would kill the fortune it had seen,
check again, find another and kill it, but by then another one had been
started.  Because the output of the script was going to /dev/null things were
running really fast.  The load had shot up unbeleavably.  At this point the
zapme was killing my login before I ever got the prompt.  All this took place
in about 6 minutes.  I called up the operator on console and told him to delete
 ~dav/bin/fortune to fix the machine.  It took me over a minute to convince him
to do it and about two minutes to delete the file because of the load.  Once
the file was gone the current running ~dav/bin/fortune failed to run another
invocation and things slowly got back to normal.

The regular users noticed a five minute halt of the machine but the users
playing games couldn't play for over half an hour.  Here at dartmouth all 
games (except fortune) can only be run by ~games.  In the games directory 
there is a script play which checks the system load (average 2 minute) and
if it is too high does not let you run the game.  It also nices the games.
When my little script ran the system load (average) went from 0.37 to 10.8
in the first minute! and over 50 before it died.  The average load did not
get below the games level for over half an hour.

dav ;)
of the load.
Technical Details
Message-ID: <18028@dartvax.Dartmouth.EDU>
Path: mbox-mo1.pugleaf.net!gmdzi!unido!mcsun!uunet!clyde.concordia.ca!jarvis.csri.toronto.edu!rutgers!shelby!husc6!bu.edu!bu-cs!dartvax!eleazar.dartmouth.edu!dav
References: <ANSELMO-ED.89Dec21120104@arizona.cs.yale.edu> <89347.200350RLE100@PSUVM.BITNET> <9154@asylum.SF.CA.US> <7056@shlump.nac.dec.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!gmdzi!unido!mcsun!uunet!clyde.concordia.ca!jarvis.csri.toronto.edu!rutgers!shelby!husc6!bu.edu!bu-cs!dartvax!eleazar.dartmouth.edu!dav
From: d...@eleazar.dartmouth.edu (William David Haas)
Newsgroups: alt.folklore.computers
Subject: Re: My true cookie story
Message-ID: <18028@dartvax.Dartmouth.EDU>
Date: 26 Dec 89 08:51:41 GMT
References: <ANSELMO-ED.89Dec21120104@arizona.cs.yale.edu> <89347.200350RLE100@PSUVM.BITNET> <9154@asylum.SF.CA.US> <7056@shlump.nac.dec.com>
Sender: ne...@dartvax.Dartmouth.EDU
Organization: Dartmouth College, Hanover, NH
Lines: 68
Posted: Tue Dec 26 09:51:41 1989
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit