From 38e5b69d6b6bed628eed98b053b4c458a2f049f0 Mon Sep 17 00:00:00 2001 From: immarvin Date: Fri, 14 Sep 2012 02:15:23 +0000 Subject: [PATCH] set nodelist.status to failed if some postbootscript failed during node privision;prohibit status update if site.nodestatus='n' git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@13790 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT/postscripts/xcatinstallpost | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/xCAT/postscripts/xcatinstallpost b/xCAT/postscripts/xcatinstallpost index fac9a991c..26eb1b628 100755 --- a/xCAT/postscripts/xcatinstallpost +++ b/xCAT/postscripts/xcatinstallpost @@ -34,7 +34,20 @@ fi DHCP_TMP=`sed 's/\(DHCPINTERFACES=\)\(.*\)$/\1"\2"/' /xcatpost/mypostscript.post` echo "$DHCP_TMP" > /xcatpost/mypostscript.post -echo "updateflag.awk \$MASTER 3002 \"installstatus booted\"" >> /xcatpost/mypostscript.post +CNS=`grep NODESTATUS= /xcatpost/mypostscript.post |awk -F = '{print $2}'` +if [ -z "$CNS" ] || [ "$CNS" != "'0'" -a "$CNS" != "'N'" -a "$CNS" != "'n'" ]; then +#update the node status during the postbootscript running +#TMP=`sed "/postbootscripts-start-here/ i\updateflag.awk \\$MASTER 3002 \\"installstatus configuring\\"" /xcatpost/mypostscript.post` +#echo "$TMP"> /xcatpost/mypostscript.post + +echo " +if [ \"\$return_value\" -eq \"0\" ]; then + updateflag.awk \$MASTER 3002 \"installstatus booted\" +else + updateflag.awk \$MASTER 3002 \"installstatus failed\" +fi +" >> /xcatpost/mypostscript.post +fi chmod +x /xcatpost/mypostscript.post if [ -x /xcatpost/mypostscript.post ];then