Take measures to try DHCP SIaddr as a xCAT master substitute if xCAT master ip is evidently unreachable

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@27 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jbjohnso 2007-10-31 03:42:29 +00:00
parent d6846d76ba
commit 48102cee50
11 changed files with 38 additions and 10 deletions

View File

@ -1,7 +1,7 @@
# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html
modprobe ipmi_si
modprobe ipmi_devintf
while ! getipmi.awk
while ! getipmi
do
echo "Retrying retrieval of IPMI settings from server"
done

View File

@ -19,8 +19,9 @@ while :; do
echo "Server notified us of standby condition, please check chain table".
echo "Retrying destiny in 15 seconds"
usleep 15000000 # something may be transiently wrong, check back in 15 seconds
while ! getdestiny.awk; do
while ! getdestiny; do
echo "Retrying destiny retrieval"
usleep 300000
done
exec $0
fi
@ -31,6 +32,7 @@ while :; do
if [ $DESTINY == "discover" ]; then
echo "MAC discovery begins"
minixcatd.awk &
usleep 500000 #Mitigate occurrances of 'failed to notify node'
while [ ! -r /restart ]; do
ifconfig -a|grep HWaddr|grep -v sit|awk '{print $1 "|" $5}'
MTM="unknown"
@ -67,20 +69,23 @@ while :; do
if [ "$SERIAL" != "unknown" ]; then
echo "<serial>$SERIAL</serial>"
fi
echo "</xcatrequest>" )| udpcat.awk $XCATMASTER $XCATPORT
usleep 30000000
echo "</xcatrequest>" ) > /tmp/discout
cat /tmp/discout | udpcat.awk $XCATMASTER $XCATPORT
usleep 5000000 #Give the preferred method 5 seconds to complete before resorting
cat /tmp/discout | udpcat.awk `cat /tmp/dhcpserver` $XCATPORT
usleep 25000000
done
#Discovery complete, restart requested.
exec /bin/restart
fi
if [ $DESTINY == "reboot" ]; then
while ! nextdestiny.awk ; do
while ! nextdestiny ; do
echo "Retrying next destiny..."
done
reboot -f
fi
if [ $DEST == "runcmd" ]; then
while ! nextdestiny.awk ; do
while ! nextdestiny ; do
echo "Retrying next destiny..."
done
$TARG
@ -103,7 +108,7 @@ while :; do
mkdir /tmp/$TARG
cd /tmp/$TARG
wget $TARG
while ! nextdestiny.awk ; do
while ! nextdestiny ; do
echo "Retrying next destiny..."
done
tar zxvf $TARG

View File

@ -0,0 +1,4 @@
#!/bin/sh
if ! getdestiny.awk 301; then
getdestiny.awk 300;
fi

View File

@ -1,7 +1,8 @@
#!/usr/bin/awk -f
# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html
BEGIN {
ns = "/inet/tcp/0/127.0.0.1/301"
localport = ARGV[1]
ns = "/inet/tcp/0/127.0.0.1/" localport
print "<xcatrequest>" |& ns
print "<command>getdestiny</command>" |& ns

View File

@ -0,0 +1,4 @@
#!/bin/sh
if ! getipmi.awk 301; then
getipmi.awk 300;
fi

View File

@ -1,7 +1,8 @@
#!/usr/bin/awk -f
# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html
BEGIN {
ns = "/inet/tcp/0/127.0.0.1/301"
localport = ARGV[1]
ns = "/inet/tcp/0/127.0.0.1/" localport
print "<xcatrequest>" |& ns
print "<command>getbmcconfig</command>" |& ns

View File

@ -0,0 +1,4 @@
#!/bin/sh
if ! nextdestiny.awk 301; then
nextdestiny.awk 300;
fi

View File

@ -3,4 +3,5 @@
rm /restart
killall -12 udhcpc;killall -10 udhcpc
sleep 5
/etc/init.d/S11stunnel #redo stunnel config
/etc/init.d/S99xcat

View File

@ -2,10 +2,12 @@
# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html
#Stunnel init for xcat:
XCATDEST=""
killall stunnel
for parm in `cat /proc/cmdline`; do
key=`echo $parm|awk -F= '{print $1}'`
if [ "$key" == "xcatd" ]; then
XCATDEST=`echo $parm|awk -F= '{print $2}'`
XCATPORT=`echo $XCATDEST|awk -F: '{print $2}'`
fi
done
mkdir -p /etc/stunnel
@ -15,5 +17,10 @@ echo 'verify=0' >> /etc/stunnel/stunnel.conf
echo '[xcatds]' >> /etc/stunnel/stunnel.conf
echo 'accept=301' >> /etc/stunnel/stunnel.conf
echo 'connect='$XCATDEST >> /etc/stunnel/stunnel.conf
if [ -r /tmp/dhcpserver ]; then
echo '[dhcps]' >> /etc/stunnel/stunnel.conf
echo 'accept=300' >> /etc/stunnel/stunnel.conf
echo 'connect='`cat /tmp/dhcpserver`':'$XCATPORT >> /etc/stunnel/stunnel.conf
fi
mkdir -p /usr/var/run/stunnel
stunnel &

View File

@ -1,7 +1,7 @@
#!/bin/sh
# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html
(
while ! /bin/getdestiny.awk
while ! /bin/getdestiny
do
echo "Retrying destiny retrieval"
done

View File

@ -5,6 +5,7 @@ deconfig)
/sbin/ifconfig $interface 0.0.0.0
;;
bound|renew)
echo $siaddr > /tmp/dhcpserver
/sbin/ifconfig $interface $ip netmask $subnet
if [ -n "$router" ] ; then
echo "deleting routers"