2007-10-26 22:44:33 +00:00
|
|
|
#
|
|
|
|
# Setup hostname
|
|
|
|
#
|
|
|
|
echo "post scripts" >/root/post.log
|
|
|
|
export PRINIC=#TABLE:noderes:THISNODE:primarynic#
|
|
|
|
if [ -z "$PRINIC" ]
|
|
|
|
then
|
|
|
|
export PRINIC=eth0
|
|
|
|
fi
|
|
|
|
IP=$(ifconfig $PRINIC | grep inet | awk '{print $2}' | awk -F: '{print $2}')
|
|
|
|
if [ -z $IP ]
|
|
|
|
then
|
|
|
|
dhclient eth0
|
|
|
|
IP=$(ifconfig $PRINIC | grep inet | awk '{print $2}' | awk -F: '{print $2}')
|
|
|
|
fi
|
|
|
|
echo "search #TABLE:site:key=domain:value#" >/etc/resolv.conf
|
|
|
|
for i in $(echo #TABLE:site:key=nameservers:value# | tr ',' ' ')
|
|
|
|
do
|
|
|
|
echo "nameserver $i"
|
|
|
|
done >>/etc/resolv.conf
|
|
|
|
export HOSTNAME=$(host $IP 2>/dev/null | awk '{print $5}' | awk -F. '{print $1}')
|
|
|
|
hostname $HOSTNAME
|
|
|
|
#
|
2009-07-23 21:03:49 +00:00
|
|
|
# put xCAT post install in init.d process
|
2007-10-26 22:44:33 +00:00
|
|
|
#
|
2009-09-30 17:27:42 +00:00
|
|
|
cat >/etc/init.d/xcatpostinit << 'EOF'
|
|
|
|
#INCLUDE:#TABLE:site:key=installdir:value#/postscripts/xcatpostinit#
|
2009-07-23 21:03:49 +00:00
|
|
|
EOF
|
|
|
|
chmod 755 /etc/init.d/xcatpostinit
|
|
|
|
ln -s /etc/init.d/xcatpostinit /etc/init.d/rc3.d/S84xcatpostinit
|
|
|
|
ln -s /etc/init.d/xcatpostinit /etc/init.d/rc4.d/S84xcatpostinit
|
|
|
|
ln -s /etc/init.d/xcatpostinit /etc/init.d/rc5.d/S84xcatpostinit
|
2008-05-13 23:33:16 +00:00
|
|
|
|
2009-07-23 21:03:49 +00:00
|
|
|
mkdir -p /opt/xcat
|
2009-09-30 17:27:42 +00:00
|
|
|
cat >/opt/xcat/xcatdsklspost << 'EOF'
|
|
|
|
#INCLUDE:#TABLE:site:key=installdir:value#/postscripts/xcatdsklspost#
|
2009-07-23 21:03:49 +00:00
|
|
|
chkconfig xcatpostinit off
|
|
|
|
EOF
|
|
|
|
TMP=`sed "/IBM(c)/ a ADDSITEYUM=1" /opt/xcat/xcatdsklspost`
|
|
|
|
echo "$TMP" > /opt/xcat/xcatdsklspost
|
|
|
|
chmod 755 /opt/xcat/xcatdsklspost
|
|
|
|
chkconfig --add xcatpostinit
|
|
|
|
|
2009-09-09 20:36:53 +00:00
|
|
|
cat >/opt/xcat/xcatinfo << EOF
|
|
|
|
XCATSERVER=#XCATVAR:XCATMASTER#
|
|
|
|
EOF
|
|
|
|
|
2009-07-23 21:03:49 +00:00
|
|
|
#something Jarrod knows
|
2008-05-27 18:21:23 +00:00
|
|
|
sed -i 's/^serial/#serial/' /boot/grub/menu.lst
|
|
|
|
sed -i 's/^terminal/#terminal/' /boot/grub/menu.lst
|
2009-07-23 21:03:49 +00:00
|
|
|
|
|
|
|
#change the chain from install to boot
|
|
|
|
cat >/tmp/updateflag.awk <<EOF
|
|
|
|
#!/usr/bin/awk -f
|
|
|
|
|
|
|
|
BEGIN {
|
|
|
|
xcatdport = #TABLE:site:key=xcatiport:value#
|
|
|
|
xcatdhost = "#XCATVAR:XCATMASTER#"
|
|
|
|
|
|
|
|
ns = "/inet/tcp/0/" xcatdhost "/" xcatdport
|
|
|
|
|
|
|
|
while(1) {
|
|
|
|
if((ns |& getline) > 0)
|
|
|
|
print \$0
|
2009-10-03 02:06:43 +00:00
|
|
|
else {
|
|
|
|
print "Retrying update"
|
|
|
|
close(ns)
|
|
|
|
system("sleep 5")
|
|
|
|
}
|
2009-07-23 21:03:49 +00:00
|
|
|
|
|
|
|
if(\$0 == "ready")
|
|
|
|
print "next" |& ns
|
|
|
|
if(\$0 == "done")
|
|
|
|
break
|
|
|
|
}
|
|
|
|
|
|
|
|
close(ns)
|
|
|
|
|
|
|
|
exit 0
|
|
|
|
}
|
|
|
|
EOF
|
|
|
|
chmod 755 /tmp/updateflag.awk
|
|
|
|
/tmp/updateflag.awk
|
|
|
|
|
|
|
|
#remove all the repos, later addsiteyum will add the one from the master node.
|
|
|
|
rm -f /etc/yum.repos.d/*
|
|
|
|
|
2007-10-26 22:44:33 +00:00
|
|
|
exit 0
|