[GE users] How to capture qdel signal

Michael van Elst mlelstv at serpens.de
Tue May 13 11:27:36 BST 2008

On Tue, May 13, 2008 at 12:52:19PM +0530, YogS wrote:
> Hello All,
> Is there any way to capture the qdel signal from within the script.
> The background is:
> I am running a job with some timeout limit. After that timeout I send qdel
> signal for that job. This timeout is different from "h_rt"
> I want the script submitted by qsub should sense that qdel and cleans all
> the temporary data it had created before coming out of grid.

You cannot catch the default signal used by qdel.

However, if you use the -notify option you get a SIGUSR2 first. You can
trap the signal and run cleanup procedures. Depending on the complexity
of your cleanup you may have to extend the notification period (default
is 60 seconds).

Another method is to add cleanup procedures to the SGE configuration
(e.g. stop_proc_args for your parallel environment). The drawback is
that such a procedure needs to know your job and what exactly is to
cleanup. Making this generic is difficult.

                                Michael van Elst
Internet: mlelstv at serpens.de
                                "A potential Snark may lurk in every tree."

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