[GE users] Does "qdel" command not recognized in Korn-Shell ?

reuti reuti at staff.uni-marburg.de
Wed May 5 18:11:44 BST 2010


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

Am 05.05.2010 um 17:51 schrieb arvindpetaru:

>> File:test.sh
>> --------------------?--------------------?--
>> #!/bin/ksh
> 
> --is this the real ksh or pdksh which was often used in the past as a replacement? Shell startup mode is set to unix_behavior or posix_compliant (only in the latter case the -S option should have an effect)? One option could be to change it to unix_behavior and the first line of the script should be honored.
> 
> Arvind> This is the real ksh. By default "shell_start_mode" was "posix_complaint" and I changed that to "unix_behavior" and that doesn't seem to work either.
> 
>> 
>> #$ -S /bin/ksh 
>> #Works fine if above is /bin/sh
>> 
>> #$ -M ramki at gmail.com
>> #$ -m abes
>> #$ -cwd
>> #$ -V
> 
> And in the submitting shell the `qdel` works I assume. Can you add:
> Arvind> Yes, qdel works fine in the submitting shell.
> 
> echo $PATH
> 
> in your demo program?
> Arvind> Below is the ouput of the script with "PATH" variable added as suggested. It doesn't seem to contain the path the sge bin files location(i.e., /tmp/sge/ge6.2/bin/sol-sparc64). But the parent shell(submitting shell) does have this path(sge directory) in the "PATH" variable. And I'm exporting everything from the parent-shell to child-shell with SGE option(#$ -V).
> 
> Below o/p is with "unix_behavior" case:-
> ===============
> SCRIPT STARTED
> PATH=.:/usr/local/SOLARIS/bin:/usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/ucb:/etc:/usr/etc:/usr/openwin/bin:/usr/ccs/bin::/emc/symmperf/character/EMCm
> ark.REV7/POST_PROCESSING_TOOLS:/usr/symcli/bin:/adiosX/bin:

Strange that the correct path is still not therein. A workaround could be to source the settings file in each script:

source $SGE_ROOT/default/common/settings.sh

which should extend the path then.

For me the -V provided already function to inherit the PATH from the submitting shell to the job.


> 
> /tmp/sge/ge6.2/default/spool//lperf011/job_scripts/25[17]: qdel:  not found
> SCRIPT ENDED
> ================
> 
>> #$ -o /tmp/nohup.out
>> #$ -j y
>> #$ -l hostname=lperf011
>> 
>> echo "SCRIPT STARTED"
>> sleep 5
>> qdel $JOB_ID
>> sleep 5
>> echo "SCRIPT ENDED"
>> exit 0
> 
> Is it a demo program, or why do you don't exit the script?
> Arvind> I'm explictly calling 'qdel' in the script for sending emails in "ABORTION" case for any failures in the script.(not demo program)

Okay, I get the idea. By default the "Completed" email will be send, when the job ended normally from SGE's point of view, end the "Aborted" only when something happened to the job. A third option "Failed" (from the application's point of view) is missing.

What you could also try: use a mail wrapper, which will check the exit code of your job (which is in the to be send email) and change the subject line accordingly. I.e.:

exitcode 17: Failed because of illegal database entry
exitcode 18: Failed because of wrong customer state
...


#!/bin/sh
awk -v SUBJECT_ORIGINAL="$2" '

BEGIN { firstrun = 1

        subject[17]="Failed because of illegal database entry"
        subject[18]="Failed because of wrong customer state"

        mail_header=SUBJECT_ORIGINAL
      }

/^ Exit Status/ {   if ($4 in subject)
                    {
                        mail_header=subject[$4]
                    }
                }

{ if ( firstrun ) {
                      message = $0
                      firstrun = 0
                  }
  else
                  {
                      message = message "\n" $0
                  }
}

END { print message | "mail -s \""mail_header"\" \""RECEIVER"\"" }' RECEIVER="$3"


-- Reuti


> -- Reuti
> 
> ------------------------------------------------------
> http://gridengine.sunsource.net/ds/viewMessage.do?dsForumId=38&dsMessageId=256280
> 
> To unsubscribe from this discussion, e-mail: [users-unsubscribe at gridengine.sunsource.net].
>

------------------------------------------------------
http://gridengine.sunsource.net/ds/viewMessage.do?dsForumId=38&dsMessageId=256289

To unsubscribe from this discussion, e-mail: [users-unsubscribe at gridengine.sunsource.net].



More information about the gridengine-users mailing list