git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@10288 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
otubo 2011-08-15 15:55:42 +00:00
parent 95da0c8dc0
commit 7d877d5dd7
12 changed files with 147 additions and 147 deletions

View File

@ -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
@ -98,9 +98,9 @@ cd /xcatpost
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
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#

View File

@ -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
mkdir -p /xcatpost
service portmap start
ifconfig

View File

@ -39,7 +39,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)
@ -61,8 +61,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
@ -74,12 +74,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
@ -104,9 +104,9 @@ cd /xcatpost
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
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'
@ -126,10 +126,10 @@ chmod 755 /opt/xcat/xcatinstallpost
chkconfig --add xcatpostinit1
#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#

View File

@ -43,7 +43,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)
@ -65,8 +65,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
@ -78,10 +78,10 @@ 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
@ -106,9 +106,9 @@ cd /xcatpost
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
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'
@ -128,10 +128,10 @@ chmod 755 /opt/xcat/xcatinstallpost
chkconfig --add xcatpostinit1
#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#

View File

@ -8,7 +8,7 @@ hostname $HOSTNAME
# Master/service node set by nodeset
export MASTER_IPS=( replace_master )
export MASTER=replace_master
cd /tmp
cd /var/tmp
RAND=$(perl -e 'print int(rand(50)). "\n"')
sleep $RAND
@ -41,8 +41,8 @@ do
chmod +x /xcatpost/*
# Get postscript to run on this node from xcat server
/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
@ -57,12 +57,12 @@ do
sleep $SLI
# Get postscript to run on this node from xcat server
/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
# Make executable
chmod +x /tmp/mypostscript
chmod +x /var/tmp/mypostscript
GOTIT=1
break
fi
@ -86,9 +86,9 @@ cd /xcatpost
export PATH=/xcatpost:$PATH
# Save post boot 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
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 post init
cat >/etc/init.d/xcatpostinit1 << 'EOF'
@ -110,9 +110,9 @@ chmod 755 /opt/xcat/xcatinstallpost
chkconfig --add xcatpostinit1
# Only run preboot scripts here
TMP=`sed "/postbootscripts-start-here/,/postbootscripts-end-here/ d" /tmp/mypostscript`
echo "$TMP" > /tmp/mypostscript
/tmp/mypostscript
TMP=`sed "/postbootscripts-start-here/,/postbootscripts-end-here/ d" /var/tmp/mypostscript`
echo "$TMP" > /var/tmp/mypostscript
/var/tmp/mypostscript
# Master/service node variable set by nodeset
updateflag.awk replace_master 3002
updateflag.awk replace_master 3002

View File

@ -8,7 +8,7 @@ hostname $HOSTNAME
# Master/service node set by nodeset
export MASTER_IPS=( replace_master )
export MASTER=replace_master
cd /tmp
cd /var/tmp
RAND=$(perl -e 'print int(rand(50)). "\n"')
sleep $RAND
@ -41,8 +41,8 @@ do
chmod +x /xcatpost/*
# Get postscript to run on this node from xcat server
/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
@ -57,12 +57,12 @@ do
sleep $SLI
# Get postscript to run on this node from xcat server
/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
# Make executable
chmod +x /tmp/mypostscript
chmod +x /var/tmp/mypostscript
GOTIT=1
break
fi
@ -86,9 +86,9 @@ cd /xcatpost
export PATH=/xcatpost:$PATH
# Save post boot 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
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 post init
cat >/etc/init.d/xcatpostinit1 << 'EOF'
@ -110,12 +110,12 @@ chmod 755 /opt/xcat/xcatinstallpost
chkconfig --add xcatpostinit1
# Only run preboot scripts here
TMP=`sed "/postbootscripts-start-here/,/postbootscripts-end-here/ d" /tmp/mypostscript`
echo "$TMP" > /tmp/mypostscript
/tmp/mypostscript
TMP=`sed "/postbootscripts-start-here/,/postbootscripts-end-here/ d" /var/tmp/mypostscript`
echo "$TMP" > /var/tmp/mypostscript
/var/tmp/mypostscript
# Master/service node variable set by nodeset
updateflag.awk replace_master 3002
# Restore default SELinux security context
restorecon -R -v /root/.ssh
restorecon -R -v /root/.ssh

View File

@ -95,8 +95,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
@ -108,10 +108,10 @@ 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
@ -133,9 +133,9 @@ PATH=/xcatpost:$PATH
export 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
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'
@ -155,9 +155,9 @@ chmod 755 /opt/xcat/xcatinstallpost
chkconfig --add xcatpostinit1
#only run the prebooot scripts here
TMP=`sed "/postbootscripts-start-here/,/postbootscripts-end-here/ d" /tmp/mypostscript`
echo "$TMP" > /tmp/mypostscript
/tmp/mypostscript
TMP=`sed "/postbootscripts-start-here/,/postbootscripts-end-here/ d" /var/tmp/mypostscript`
echo "$TMP" > /var/tmp/mypostscript
/var/tmp/mypostscript
updateflag.awk $MASTER 3002
cd /
/xcatpost/#TABLE:nodelist:$NODE:node#

View File

@ -51,8 +51,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
@ -64,10 +64,10 @@ 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
@ -88,10 +88,10 @@ done
PATH=/xcatpost:$PATH
export 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'
@ -111,14 +111,14 @@ chmod 755 /opt/xcat/xcatinstallpost
chkconfig --add xcatpostinit1
#only run the prebooot scripts here
TMP=`sed "/postbootscripts-start-here/,/postbootscripts-end-here/ d" /tmp/mypostscript`
echo "$TMP" > /tmp/mypostscript
/tmp/mypostscript
TMP=`sed "/postbootscripts-start-here/,/postbootscripts-end-here/ d" /var/tmp/mypostscript`
echo "$TMP" > /var/tmp/mypostscript
/var/tmp/mypostscript
updateflag.awk $MASTER 3002
cd /
/xcatpost/#TABLE:nodelist:$NODE:node#
#rm -Rf /xcatpost
#rm -f /tmp/mypostscript
#rm -f /var/tmp/mypostscript
#rmdir /xcatpost
]]>

View File

@ -7,15 +7,15 @@
#!/bin/sh
# Set MAC address
cat /etc/sysconfig/network/ifcfg-replace_device | grep -v "LLADDR" | grep -v "UNIQUE" > /tmp/ifcfg-replace_device
echo "LLADDR='replace_lladdr'" >> /tmp/ifcfg-replace_device
echo "UNIQUE=''" >> /tmp/ifcfg-replace_device
cat /tmp/ifcfg-replace_device > /etc/sysconfig/network/ifcfg-replace_device
cat /etc/sysconfig/network/ifcfg-replace_device | grep -v "LLADDR" | grep -v "UNIQUE" > /var/tmp/ifcfg-replace_device
echo "LLADDR='replace_lladdr'" >> /var/tmp/ifcfg-replace_device
echo "UNIQUE=''" >> /var/tmp/ifcfg-replace_device
cat /var/tmp/ifcfg-replace_device > /etc/sysconfig/network/ifcfg-replace_device
# Set layer = 2
cat /etc/sysconfig/hardware/hwcfg-replace_device | grep -v "QETH_LAYER2_SUPPORT" > /tmp/hwcfg-replace_device
echo "QETH_LAYER2_SUPPORT='1'" >> /tmp/hwcfg-replace_device
cat /tmp/hwcfg-replace_device > /etc/sysconfig/hardware/hwcfg-replace_device
cat /etc/sysconfig/hardware/hwcfg-replace_device | grep -v "QETH_LAYER2_SUPPORT" > /var/tmp/hwcfg-replace_device
echo "QETH_LAYER2_SUPPORT='1'" >> /var/tmp/hwcfg-replace_device
cat /var/tmp/hwcfg-replace_device > /etc/sysconfig/hardware/hwcfg-replace_device
# Get node hostname
HOSTNAME=$(hostname -s)
@ -52,8 +52,8 @@ do
chmod +x /xcatpost/*
# Get postscript to run on this node from xcat server
/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
@ -67,12 +67,12 @@ do
sleep $SLI
# Get postscript to run on this node from xcat server
/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
# Make executable
chmod +x /tmp/mypostscript
chmod +x /var/tmp/mypostscript
GOTIT=1
break
fi
@ -99,9 +99,9 @@ PATH=/xcatpost:$PATH
export PATH
# Save post boot 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
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 post init
cat >/etc/init.d/xcatpostinit1 << 'EOF'
@ -127,11 +127,11 @@ chmod 755 /opt/xcat/xcatinstallpost
chkconfig --add xcatpostinit1
# Only run 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
# Run postscripts
/tmp/mypostscript
/var/tmp/mypostscript
# Master node is set by nodeset
updateflag.awk replace_master 3002
@ -139,4 +139,4 @@ cd /
]]>
</source>
</script>
</post-scripts>
</post-scripts>

View File

@ -16,8 +16,8 @@ BOOTPROTO=dhcp
STARTMODE=onboot
EOF
. /tmp/prinicsetting
rm /tmp/prinicsetting
. /var/tmp/prinicsetting
rm /var/tmp/prinicsetting
if [ "$PRINIC" != "eth0" ]
then
cd /etc/sysconfig/network
@ -78,8 +78,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
@ -91,10 +91,10 @@ 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
@ -116,9 +116,9 @@ PATH=/xcatpost:$PATH
export 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
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'
@ -138,10 +138,10 @@ chmod 755 /opt/xcat/xcatinstallpost
chkconfig --add xcatpostinit1
#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
updateflag.awk $MASTER 3002
cd /

View File

@ -57,8 +57,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
@ -70,10 +70,10 @@ 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
@ -95,9 +95,9 @@ PATH=/xcatpost:$PATH
export 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
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'
@ -117,10 +117,10 @@ chmod 755 /opt/xcat/xcatinstallpost
chkconfig --add xcatpostinit1
#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
updateflag.awk $MASTER 3002
cd /
/xcatpost/#TABLE:nodelist:$NODE:node#

View File

@ -7,11 +7,11 @@
#!/bin/sh
# Set MAC address
cat /etc/sysconfig/network/ifcfg-replace_device | grep -v "LLADDR" | grep -v "UNIQUE" > /tmp/ifcfg-replace_device
echo "LLADDR='replace_lladdr'" >> /tmp/ifcfg-replace_device
echo "UNIQUE=''" >> /tmp/ifcfg-replace_device
echo "NAME='OSA Express Network card (replace_nic_addr)'" >> /tmp/ifcfg-replace_device
cat /tmp/ifcfg-replace_device > /etc/sysconfig/network/ifcfg-replace_device
cat /etc/sysconfig/network/ifcfg-replace_device | grep -v "LLADDR" | grep -v "UNIQUE" > /var/tmp/ifcfg-replace_device
echo "LLADDR='replace_lladdr'" >> /var/tmp/ifcfg-replace_device
echo "UNIQUE=''" >> /var/tmp/ifcfg-replace_device
echo "NAME='OSA Express Network card (replace_nic_addr)'" >> /var/tmp/ifcfg-replace_device
cat /var/tmp/ifcfg-replace_device > /etc/sysconfig/network/ifcfg-replace_device
# Get node hostname
HOSTNAME=$(hostname -s)
@ -48,8 +48,8 @@ do
chmod +x /xcatpost/*
# Get postscript to run on this node from xcat server
/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
@ -63,12 +63,12 @@ do
sleep $SLI
# Get postscript to run on this node from xcat server
/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
# Make executable
chmod +x /tmp/mypostscript
chmod +x /var/tmp/mypostscript
GOTIT=1
break
fi
@ -95,9 +95,9 @@ PATH=/xcatpost:$PATH
export PATH
# Save post boot 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
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 post init
cat >/etc/init.d/xcatpostinit1 << 'EOF'
@ -123,11 +123,11 @@ chmod 755 /opt/xcat/xcatinstallpost
chkconfig --add xcatpostinit1
# Only run 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
# Run postscripts
/tmp/mypostscript
/var/tmp/mypostscript
# Master node is set by nodeset
updateflag.awk replace_master 3002
@ -135,4 +135,4 @@ cd /
]]>
</source>
</script>
</post-scripts>
</post-scripts>