[GE users] Cleanup on Rescheduling and Deleting

Fred L Youhanaie fly at anydata.co.uk
Tue Jan 25 15:36:27 GMT 2005


    [ The following text is in the "ISO-8859-1" character set. ]
    [ Your display is set for the "ISO-8859-10" character set.  ]
    [ Some special characters may be displayed incorrectly. ]


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