diff --git a/xCAT-server/share/xcat/install/scripts/post.ubuntu b/xCAT-server/share/xcat/install/scripts/post.ubuntu index 5d50e878d..20bd8bf01 100755 --- a/xCAT-server/share/xcat/install/scripts/post.ubuntu +++ b/xCAT-server/share/xcat/install/scripts/post.ubuntu @@ -155,10 +155,15 @@ run_ps () { local logfile=\"/var/log/xcat/xcat.log\" if [ -f \$1 ]; then - msgutil_r \"\$MASTER_IP\" \"info\" "\"\`date\` Running postscript: \$@\"" \"\$logfile\" - bash -x ./\$@ 2>&1 | tee -a \$logfile - ret_local=\${PIPESTATUS[0]} - msgutil_r \"\$MASTER_IP\" \"info\" "\"\`date\` postscript \$@ return with \$ret_local\"" \"\$logfile\" + msgutil_r \"\$MASTER_IP\" \"info\" "\"\`date\` Running postscript: \$*\"" \"\$logfile\" + if [ \"\$XCATDEBUGMODE\" = \"1\" ]; then + bash -x ./\$@ 2>&1 | tee -a \$logfile + ret_local=\${PIPESTATUS[0]} + else + ./\$@ 2>&1 | tee -a \$logfile + ret_local=\${PIPESTATUS[0]} + fi + msgutil_r \"\$MASTER_IP\" \"info\" "\"\`date\` postscript \$* return with \$ret_local\"" \"\$logfile\" if [ \"\$ret_local\" -ne \"0\" ]; then return_value=\$ret_local fi diff --git a/xCAT-server/share/xcat/install/scripts/post.xcat b/xCAT-server/share/xcat/install/scripts/post.xcat index 1b7fe568f..40e0d7c63 100755 --- a/xCAT-server/share/xcat/install/scripts/post.xcat +++ b/xCAT-server/share/xcat/install/scripts/post.xcat @@ -140,7 +140,7 @@ run_ps () { local logfile=\"/var/log/xcat/xcat.log\" if [ -f \$1 ]; then - msgutil_r \"\$MASTER_IP\" \"info\" "\"\`date\` Running postscript: \$@\"" \"\$logfile\" + msgutil_r \"\$MASTER_IP\" \"info\" "\"\`date\` Running postscript: \$*\"" \"\$logfile\" if [ \"\$XCATDEBUGMODE\" = \"1\" ]; then bash -x ./\$@ 2>&1 | tee -a \$logfile ret_local=\${PIPESTATUS[0]} @@ -148,7 +148,7 @@ run_ps () { ./\$@ 2>&1 | tee -a \$logfile ret_local=\${PIPESTATUS[0]} fi - msgutil_r \"\$MASTER_IP\" \"info\" "\"\`date\` postscript \$@ return with \$ret_local\"" \"\$logfile\" + msgutil_r \"\$MASTER_IP\" \"info\" "\"\`date\` postscript \$* return with \$ret_local\"" \"\$logfile\" if [ \"\$ret_local\" -ne \"0\" ]; then return_value=\$ret_local fi diff --git a/xCAT/postscripts/xcatdsklspost b/xCAT/postscripts/xcatdsklspost index 986c17d87..ccd1b74d4 100755 --- a/xCAT/postscripts/xcatdsklspost +++ b/xCAT/postscripts/xcatdsklspost @@ -259,7 +259,7 @@ fi xcatpost="/xcatpost" # Check for debug mode and you have nodename available you can change the path for debug -echolog "debug" "running $0 $@" +echolog "debug" "running $0 $*" if [ -n "$XCATDEBUG" ]; then @@ -827,8 +827,8 @@ run_ps () { logfile=\"/var/log/xcat/xcat.log\" if [ -f \$1 ]; then - echo \"\`date\` Running postscript: \$@\" - msgutil_r \$MASTER_IP \"debug\" \"\`date\` Running postscript: \$@\" \"\$logfile\" + echo \"\`date\` Running postscript: \$*\" + msgutil_r \$MASTER_IP \"debug\" \"\`date\` Running postscript: \$*\" \"\$logfile\" if [ \"\$XCATDEBUGMODE\" = \"1\" ]; then bash -x ./\$@ 2>&1 | tee -a \$logfile ret_local=\${PIPESTATUS[0]} @@ -840,11 +840,11 @@ run_ps () { if [ \"\$ret_local\" -ne \"0\" ]; then return_value=\$ret_local fi - echo \"Postscript: \$@ exited with code \$ret_local\" - msgutil_r \$MASTER_IP \"debug\" \"\`date\` Postscript: \$@ exited with code \$ret_local\" \"\$logfile\" + echo \"Postscript: \$* exited with code \$ret_local\" + msgutil_r \$MASTER_IP \"debug\" \"\`date\` Postscript: \$* exited with code \$ret_local\" \"\$logfile\" else echo \"\`date\` Postscript \$1 does NOT exist.\" - msgutil_r \$MASTER_IP \"debug\" \"\`date\` Postscript: \$@ exited with code \$ret_local\" \"\$logfile\" + msgutil_r \$MASTER_IP \"debug\" \"\`date\` Postscript: \$* exited with code \$ret_local\" \"\$logfile\" return_value=-1 fi