From e58d4adf3d3dedab8af5309408f0156dbcb21241 Mon Sep 17 00:00:00 2001 From: otubo Date: Sat, 13 Aug 2011 17:54:25 +0000 Subject: [PATCH] Fix for bug #3391028 git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@10282 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- .../share/xcat/install/scripts/post.ubuntu | 28 +++++++++---------- xCAT/postscripts/xcatinstallpost | 19 ++++++++----- 2 files changed, 26 insertions(+), 21 deletions(-) diff --git a/xCAT-server/share/xcat/install/scripts/post.ubuntu b/xCAT-server/share/xcat/install/scripts/post.ubuntu index 2bb38be0d..8317f9730 100644 --- a/xCAT-server/share/xcat/install/scripts/post.ubuntu +++ b/xCAT-server/share/xcat/install/scripts/post.ubuntu @@ -33,7 +33,7 @@ hostname $HOSTNAME export MASTER_IP="#XCATVAR:XCATMASTER#" export MASTER_IPS="#XCATVAR:XCATMASTER#" export MASTER="#XCATVAR:XCATMASTER#" -cd /tmp +cd /var/tmp RAND=$(perl -e 'print int(rand(50)). "\n"') sleep $RAND for i in $(seq 1 20) @@ -55,8 +55,8 @@ do mv $i/postscripts /xcatpost rm -rf $i chmod +x /xcatpost/* - /xcatpost/getpostscript.awk |sed -e 's/<[^>]*>//g'|egrep -v '^ *$'|sed -e 's/^ *//' > /tmp/mypostscript - MYCONT=`grep MASTER /tmp/mypostscript` + /xcatpost/getpostscript.awk |sed -e 's/<[^>]*>//g'|egrep -v '^ *$'|sed -e 's/^ *//' > /var/tmp/mypostscript + MYCONT=`grep MASTER /var/tmp/mypostscript` MAX_RETRIES=10 RETRY=0 while [ -z "$MYCONT" ]; do @@ -68,12 +68,12 @@ do let SLI=$RANDOM%10+10 sleep $SLI - /xcatpost/getpostscript.awk |sed -e 's/<[^>]*>//g'|egrep -v '^ *$'|sed -e 's/^ *//' > /tmp/mypostscript - MYCONT=`grep MASTER /tmp/mypostscript` + /xcatpost/getpostscript.awk |sed -e 's/<[^>]*>//g'|egrep -v '^ *$'|sed -e 's/^ *//' > /var/tmp/mypostscript + MYCONT=`grep MASTER /var/tmp/mypostscript` done - chmod +x /tmp/mypostscript + chmod +x /var/tmp/mypostscript GOTIT=1 break fi @@ -97,10 +97,10 @@ cd /xcatpost #/xcatpost/#TABLE:nodelist:THISNODE:node# export PATH=/xcatpost:$PATH -#save the postboot scripts to /tmp/mypostscript.post -TMP=`sed "/postscripts-start-here/,/postscripts-end-here/ d" /tmp/mypostscript` -echo "$TMP" > /tmp/mypostscript.post -chmod 755 /tmp/mypostscript.post +#save the postboot scripts to /var/tmp/mypostscript.post +TMP=`sed "/postscripts-start-here/,/postscripts-end-here/ d" /var/tmp/mypostscript` +echo "$TMP" > /var/tmp/mypostscript.post +chmod 755 /var/tmp/mypostscript.post #create the post init cat >/etc/init.d/xcatpostinit1 << 'EOF' @@ -116,10 +116,10 @@ EOF chmod 755 /opt/xcat/xcatinstallpost #only run the prebooot scripts here -TMP=`sed "/postbootscripts-start-here/,/postbootscripts-end-here/ d" /tmp/mypostscript` -echo "$TMP" > /tmp/mypostscript +TMP=`sed "/postbootscripts-start-here/,/postbootscripts-end-here/ d" /var/tmp/mypostscript` +echo "$TMP" > /var/tmp/mypostscript -/tmp/mypostscript +/var/tmp/mypostscript export NODE=#TABLE:nodelist:THISNODE:node# export OSVER=#TABLE:nodetype:THISNODE:os# export ARCH=#TABLE:nodetype:THISNODE:arch# @@ -136,6 +136,6 @@ sed -i 's/\(deb.*security.*\)/#\1/' /etc/apt/sources.list updateflag.awk $MASTER 3002 cd / #rm -Rf /xcatpost -#rm -f /tmp/mypostscript +#rm -f /var/tmp/mypostscript exit 0 diff --git a/xCAT/postscripts/xcatinstallpost b/xCAT/postscripts/xcatinstallpost index 9f5ddba0d..75df1bcb4 100755 --- a/xCAT/postscripts/xcatinstallpost +++ b/xCAT/postscripts/xcatinstallpost @@ -20,7 +20,7 @@ export PATH chmod +x /xcatpost/*; if [ -x /usr/bin/openssl ]; then - SIP=`grep "^MASTER=" /tmp/mypostscript.post |cut -d= -f2` + SIP=`grep "^MASTER=" /var/tmp/mypostscript.post |cut -d= -f2` XCATSERVER="$SIP:3001" export XCATSERVER USEOPENSSLFORXCAT=1 #Though this is the only method going forward, flag to allow backward compatibility with 2.2 generated netboot images @@ -28,12 +28,17 @@ if [ -x /usr/bin/openssl ]; then fi -DHCP_TMP=`sed 's/\(DHCPINTERFACES=\)\(.*\)$/\1"\2"/' /tmp/mypostscript.post` -echo "$DHCP_TMP" > /tmp/mypostscript.post +DHCP_TMP=`sed 's/\(DHCPINTERFACES=\)\(.*\)$/\1"\2"/' /var/tmp/mypostscript.post` +echo "$DHCP_TMP" > /var/tmp/mypostscript.post -echo "updateflag.awk \$MASTER 3002 \"installstatus booted\"" >> /tmp/mypostscript.post +echo "updateflag.awk \$MASTER 3002 \"installstatus booted\"" >> /var/tmp/mypostscript.post -chmod +x /tmp/mypostscript.post -if [ -x /tmp/mypostscript.post ];then - /tmp/mypostscript.post +chmod +x /var/tmp/mypostscript.post +if [ -x /var/tmp/mypostscript.post ];then + /var/tmp/mypostscript.post +fi + +chmod +x /var/tmp/mypostscript.post +if [ -x /var/tmp/mypostscript.post ];then + /var/tmp/mypostscript.post fi