From a4b2da2f4cf28b3cf1f9d88ab0a8ee71924a0810 Mon Sep 17 00:00:00 2001 From: nott Date: Tue, 24 Jan 2012 20:14:33 +0000 Subject: [PATCH] addtional output git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@11409 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-client/bin/xcatchroot | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/xCAT-client/bin/xcatchroot b/xCAT-client/bin/xcatchroot index d37bb7db1..acfec9da6 100755 --- a/xCAT-client/bin/xcatchroot +++ b/xCAT-client/bin/xcatchroot @@ -70,6 +70,7 @@ location="" osimage="" cmd_string="" verbose=0 +error=0 usage="Usage:\n\txcatchroot -h\n\txcatchroot [-V] -i osimage cmd_string" @@ -254,7 +255,19 @@ else then echo "Running command: ${chroot} /usr/xcatchrootscript\n" fi - ${chroot} /usr/xcatchrootscript + msg=`${chroot} /usr/xcatchrootscript` + + rc=$? + + echo "\n\n$msg\n\n" + + if [ ${rc} -ne 0 ] + then + error=1 + echo "\nError: The chroot command failed for '$cmd_string'." + echo "Error: The return code from chroot was '${rc}'\n" + fi + # sensitive process has completed ${M_CHATTR} -a Rstate=available $spotObj @@ -268,13 +281,11 @@ else fi # remove the tmp script -if [ $verbose -eq 1 ] -then - echo "Running command: 'rm $location/xcatchrootscript'\n" -fi -`rm $location/xcatchrootscript` - -# echo "\nNote: Be sure to perform the NIM check operation after completing NIM spot\nupdates. (ex. 'nim -o check ')" +/usr/bin/rm $location/xcatchrootscript # all done +if [ $error -eq 1 ] +then + exit 1 +fi exit 0