From 459cef9485b7a86dd1a54108793ebdc379cc2159 Mon Sep 17 00:00:00 2001 From: Alexander Lutay Date: Fri, 14 Apr 2017 10:18:18 +0200 Subject: [PATCH] TT#14516 Add more debug for ngcp-installer execution section from grml-chroot It should improve debuging the situation with non-zero exit codes. Change-Id: Icc5816ac0f710bc8b005bb136b2691e478361c5a --- deployment.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) mode change 100755 => 100644 deployment.sh diff --git a/deployment.sh b/deployment.sh old mode 100755 new mode 100644 index 9a55778..47dcfad --- a/deployment.sh +++ b/deployment.sh @@ -1714,16 +1714,18 @@ EOT gen_installer_config # execute ngcp-installer - cat << EOT | grml-chroot $TARGET /bin/bash + cat << "EOT" | grml-chroot $TARGET /bin/bash +echo "Running ngcp-installer via grml-chroot." | tee -a /tmp/ngcp-installer-debug.log ngcp-installer 2>&1 | tee -a /tmp/ngcp-installer-debug.log -RC=\${PIPESTATUS[0]} -if [ \$RC -ne 0 ] ; then - echo "ERROR: Fatal error while running ngcp-installer!" >&2 - exit \$RC +RC=${PIPESTATUS[0]} +if [ "${RC}" = "0" ] ; then + echo "OK, ngcp-installer finished with exit code '${RC}', continue netscript deployment." | tee -a /tmp/ngcp-installer-debug.log +else + echo "ERROR: Fatal error while running ngcp-installer (exit code '${RC}')!" | tee -a /tmp/ngcp-installer-debug.log >&2 + exit ${RC} fi EOT - # baby, something went wrong! if [ $? -eq 0 ] ; then logit "installer: success" else