[GE users] qdel

Olesen, Mark Mark.Olesen at emcontechnologies.com
Tue Sep 18 13:49:17 BST 2007

    [ 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. ]

> I have an application that detects the presence of a file ".isstopping" to
kill its paralell child processes
> on different hosts. I wan't this file to be created upon a "qdel"
invocation for this specific application.
> My initial focus was the "PE" stop_procedure, but it's only executed AFTER
the completion of the job-script,
> so that won't help me much.
> I need to catch the "qdel" and act on this by creating that file and wait
for some time before killing the
> job to let the application finish up.
> My question is: How would I achieve this in a good way?
> I've read something about trapping SIGKILL or SIGTERM, but I'd figure
there are good ideas out there....

You could try with the qsub '-notify' option.

As an example, we have a few daemonized programs that run parallel to our

start_aux() {
  echo "(**) start auxiliary processes"

kill_aux() {
  trap '' EXIT          ## no further need to cleanup
  echo "(**) kill auxiliary processes"

stop_aux() {
  echo "(**) stop auxiliary processes"

# Before starting:


# with '-notify' we receive
#   STOP => USR1 (suspend)
#   KILL => USR2 (kill)
trap 'kill_aux' USR1 USR2
trap 'stop_aux' EXIT

You'll likely have to play with the notify time to make sure you have enough
time for the application to react before the final STOP/KILL signals get

I also noticed some strangeness with OpenMPI and these signals, but haven't
tried it again recently.

This e-mail message and any attachments may contain legally privileged, confidential or proprietary Information, or information otherwise protected by law of EMCON Technologies, its affiliates, or third parties. This notice serves as marking of its ?Confidential? status as defined in any confidentiality agreements concerning the sender and recipient. If you are not the intended recipient(s), or the employee or agent responsible for delivery of this message to the intended recipient(s), you are hereby notified that any dissemination, distribution or copying of this e-mail message is strictly prohibited. If you have received this message in error, please immediately notify the sender and delete this e-mail message from your computer.

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