diff --git a/helm/hpcc/templates/_helpers.tpl b/helm/hpcc/templates/_helpers.tpl index ad49c711fbc..b1657b67a14 100644 --- a/helm/hpcc/templates/_helpers.tpl +++ b/helm/hpcc/templates/_helpers.tpl @@ -1933,9 +1933,10 @@ lifecycle: {{- if $postRun -}} {{- $args = append $args "-p" -}} {{- end -}} - {{- $args = concat $args (list "-d" $prefix "-c" $containerName "--") -}} + {{- $args = concat $args (list "-d" $prefix "-c" $containerName) -}} {{- $_ := set .lifeCycleCtx "containers" (append .lifeCycleCtx.containers (dict "name" $containerName "process" .process "config" $configCtx.name)) -}} {{- end -}} +{{- $args = append $args "--" -}} {{- $args = append $args .process -}} {{- $args = append $args (include "hpcc.configArg" $configCtx) -}} {{- $args = append $args (include "hpcc.daliArg" .) -}} diff --git a/initfiles/bin/check_executes.sh b/initfiles/bin/check_executes.sh index 405c8885eea..d3378618b3f 100755 --- a/initfiles/bin/check_executes.sh +++ b/initfiles/bin/check_executes.sh @@ -15,13 +15,15 @@ eval set -- "$1" usage() { - echo "Usage: check_executes [options] -- cmd args" + echo "Usage: check_executes.sh [options] -- cmd args" echo " -c The name of the container" echo " -d Mounted directory to store post-mortem info in" - echo " -f Specifies a file to preserve on post-mortem" + echo " -a Always collect post-mortem info, even if the process exits cleanly" + echo " -v Run the process under valgrind" + echo " -p This is a postrun sidecar container" } -PMD_DIRECTORYBASE=$(pwd) +PMD_DIRECTORYBASE= PMD_PROGNAME= PMD_DALISERVER= PMD_WORKUNIT= @@ -152,9 +154,13 @@ if [ $PMD_ALWAYS = true ] || [ $retVal -ne 0 ]; then if [[ -n "$PMD_WORKUNIT" ]]; then extraArgs+=("--workunit=$PMD_WORKUNIT") fi - echo "Collecting post mortem info" - collect_postmortem.sh "--directory=${PMD_DIRECTORYBASE}" "--daliServer=${PMD_DALISERVER}" "--container=${PMD_CONTAINERNAME}" "--process=${PMD_PROGNAME}" "${extraArgs[@]}" - echo "Post mortem collection completed" + if [[ -n "$PMD_DIRECTORYBASE" ]]; then + echo "Collecting post mortem info" + collect_postmortem.sh "--directory=${PMD_DIRECTORYBASE}" "--daliServer=${PMD_DALISERVER}" "--container=${PMD_CONTAINERNAME}" "--process=${PMD_PROGNAME}" "${extraArgs[@]}" + echo "Post mortem collection completed" + else + echo "Post mortem directory not provided, unable to collect post mortem info" + fi else echo "Process exited cleanly (code=0)" fi