Description
The kill wrapper script should instruct the DRM system to kill the jobs identified by the IDs given. 3DOrchestrate writes the command arguments and command output to the 3DOrchestrate Distribution Server log file.
DescriptionThe kill wrapper script should instruct the DRM system to kill the jobs identified by the IDs given. 3DOrchestrate writes the command arguments and command output to the 3DOrchestrate Distribution Server log file. Syntax<killPath> drmjobid1 ... drmjobidn where:
ReturnThe kill script should return JavaScript Object Notation (JSON) in the following format: [ {drmjobid:"<DRM_JOB_ID>",jobstatus:"<DRM_JOB_STATUS>",message:"<MESSAGE>"}, {drmjobid:"<DRM_JOB_ID>",jobstatus:"<DRM_JOB_STATUS>",message:"<MESSAGE>"}, ... {drmjobid:"<DRM_JOB_ID>",jobstatus:"<DRM_JOB_STATUS>",message:"<MESSAGE>"} ] where:
Note:
If the kill script is erroneous, 3DOrchestrate fails the kill operation.
ExampleAn example Perl script for the kill command for IBM Spectrum LSF is shown below. #!/usr/bin/env perl # #SCRIPT ARGUMENTS: # $0 drmjobid1 ... drmjobidN # #DEBUG OUTPUT: # written to catalina.out when fiper.system.<DRM_NAME>.debugLog=true # #SCRIPT OUTPUT # # JSON: # [ # { drmjobid: "<DRM_JOB_ID>", jobstatus:"<DRM_JOB_STATUS>", message: "<MESSAGE>" }, # { drmjobid: "<DRM_JOB_ID>", jobstatus:"<DRM_JOB_STATUS>", message: "<MESSAGE>" }, # { drmjobid: "<DRM_JOB_ID>", jobstatus:"<DRM_JOB_STATUS>", message: "<MESSAGE>" } # ] # where: # <DRM_JOB_ID> = DRM Job ID # <DRM_JOB_STATUS> = DRM Job Status, Status could be any of the following: # SUCCESS # FAILED # <MESSAGE> = DRM message use strict; use JSON; my %jobInfo; open(TMP,">/tmp/bkill_debug.$$.out"); print TMP "debug args: " . join(",",@ARGV) . "\n"; close TMP; open(BKILL, "bkill @ARGV 2>&1 |"); while(<BKILL>) { chomp; if (/Job\s+\<(\d+)\>\s+is\s+being\s+terminated/) { my $jobID = $1; $jobInfo{$jobID}{'drmjobid'} = $jobID; $jobInfo{$jobID}{'jobstatus'} = "SUCCESS"; $jobInfo{$jobID}{'message'} = "Job is being terminated."; } if (/Job\s+\<(\d+)\>\:\s+(.*)/) { my $jobID = $1; my $message = $2; $jobInfo{$jobID}{'drmjobid'} = $jobID; $jobInfo{$jobID}{'jobstatus'} = "FAILED"; $jobInfo{$jobID}{'message'} = "$message"; } } close BKILL; my $json = "\["; foreach my $id (keys %jobInfo) { $json .= to_json \%{$jobInfo{$id}}; $json .= ","; } $json =~ s/\,$//; $json .= "\]"; print "$json\n"; exit 0; |