[GE users] Cleanup on Rescheduling and Deleting

Dan Gruhn Dan.Gruhn at Group-W-Inc.com
Tue Jan 25 16:30:06 GMT 2005


Hi Fred,

You are right, in a standard case I do want an exit.  For this test
script, I want to continue to output so I can see how long after the
notification the script is finally killed.

Thanks,

Dan
On Tue, 2005-01-25 at 10:36, Fred L Youhanaie wrote:

> Hi Dan,
> 
> You need an explicit exit in the trap, i.e.
> 
> trap "cleanup ... ; exit" ...
> 
> or put an 'exit' inside the cleanup function.
> 
> Otherwise the script will continue execution after the execution of cleanup.
> 
> Cheers
> f.
> 
> 
> > 
> > trap "cleanup Usr2" USR2
> > 
> > trap "cleanup Term" TERM
> > trap "cleanup Quit" QUIT
> > trap "cleanup Hup" HUP
> > trap "cleanup Int" INT
> > 
> > outputFile="output.$$"
> > 
> > touch $outputFile
> > mkdir temp$$
> > 
> > cleanup()
> > {
> > 	echo "`date`: Host=$xeqHost, Restarted=$RESTARTED, counter=$counter,
> > Signal: $1" >>$outputFile
> > 	mv $outputFile output.done.$$
> > 	outputFile="output.done.$$"
> > 	rm -rf temp$$
> > }
> ...
> > Tue Jan 25 09:53:19 EST 2005: Host=dwarme-lx, Restarted=1, counter=27
> > Tue Jan 25 09:53:20 EST 2005: Host=dwarme-lx, Restarted=1, counter=28
> > Tue Jan 25 09:53:21 EST 2005: Host=dwarme-lx, Restarted=1, counter=28,
> > Signal: Usr2
> > Tue Jan 25 09:53:21 EST 2005: Host=dwarme-lx, Restarted=1, counter=29
> > Tue Jan 25 09:53:22 EST 2005: Host=dwarme-lx, Restarted=1, counter=30
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe at gridengine.sunsource.net
> For additional commands, e-mail: users-help at gridengine.sunsource.net
> 



More information about the gridengine-users mailing list