File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -111,7 +111,7 @@ taskwrapper() {
111111 # the command might be a complex block: For the timing measurement below
112112 # it is better to execute this as a script
113113 SCRIPTNAME=" ${logfile} _tmp.sh"
114- echo " ${command} " > ${SCRIPTNAME}
114+ echo " ${command} ; echo \" TASK-EXIT-CODE: $? \" " > ${SCRIPTNAME}
115115 chmod +x ${SCRIPTNAME}
116116
117117 # this gives some possibility to customize the wrapper
@@ -372,9 +372,9 @@ taskwrapper() {
372372
373373 # wait for PID and fetch return code
374374 # ?? should directly exit here?
375- wait $PID
376- # return code
377- RC=$?
375+ wait $PID || QUERY_RC_FROM_LOG= " ON "
376+ # query return code from log (seems to be safer as sometimes the wait issues "PID" not a child of this shell)
377+ RC=$( grep " TASK-EXIT-CODE: " ${logfile} | awk ' //{print $2} ' )
378378 RC_ACUM=$(( RC_ACUM+ RC))
379379 if [ " ${RC} " -eq " 0" ]; then
380380 if [ ! " ${JOBUTILS_JOB_SKIPCREATEDONE} " ]; then
You can’t perform that action at this time.
0 commit comments