To make bmcsetup cmd to update node status to be [bmcready] in genesis; And make chain mechanism to support [shutdown] key word which is used to poweroff the node

This commit is contained in:
daniceexi 2014-01-13 07:54:05 -05:00
parent dd3f08682f
commit 35376641b4
5 changed files with 47 additions and 1 deletions

View File

@ -56,6 +56,7 @@ $::STATUS_SHELL="shell";
$::STATUS_DEFINED="defined";
$::STATUS_UNKNOWN="unknown";
$::STATUS_FAILED="failed";
$::STATUS_BMCREADY="bmcready";
%::VALID_STATUS_VALUES = (
$::STATUS_ACTIVE=>1,
$::STATUS_INACTIVE=>1,
@ -72,6 +73,7 @@ $::STATUS_FAILED="failed";
$::STATUS_DEFINED=>1,
$::STATUS_UNKNOWN=>1,
$::STATUS_FAILED=>1,
$::STATUS_BMCREADY=>1,
$::STATUS_SYNCING=>1,
$::STATUS_OUT_OF_SYNC=>1,

View File

@ -381,6 +381,16 @@ if [ ! "$IPMIVER" == "1.5" ]; then
if [ $TRIES -gt $TIMEOUT ]; then echo "ERROR"; else echo "OK"; fi
fi
# update the node status to 'bmcready'
for parm in `cat /proc/cmdline`; do
key=`echo $parm|awk -F= '{print $1}'`
if [ "$key" = "xcatd" ]; then
XCATMASTER=`echo $parm|awk -F= '{print $2}'|awk -F: '{print $1}'`
fi
done
if [ ! -z "$XCATMASTER" ]; then
updateflag.awk $XCATMASTER 3002 "installstatus bmcready"
fi
#frume.awk
echo "Lighting Identify Light"

View File

@ -189,6 +189,8 @@ while :; do
sleep 1
done
echo "Retrying ";
elif [ "$dest" = shutdown ]; then
poweroff -f
else
echo "Unrecognized directive $dest"
destiny=''

View File

@ -0,0 +1,32 @@
#!/usr/bin/awk -f
# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html
BEGIN {
xcatdhost = ARGV[1]
xcatdport = ARGV[2]
flag = ARGV[3]
if (!flag) flag = "next"
ns = "/inet/tcp/0/" ARGV[1] "/" xcatdport
while(1) {
if((ns |& getline) > 0)
print $0 | "logger -t xcat -p local4.info"
else {
print "Retrying flag update" | "logger -t xcat -p local4.info"
close(ns)
system("sleep 10")
}
if($0 == "ready")
print flag |& ns
if($0 == "done")
break
}
close(ns)
exit 0
}

View File

@ -453,7 +453,7 @@ sub setdestiny {
return;
}
}
} elsif ($state eq "offline") {
} elsif ($state eq "offline" || $state eq "shutdown") {
1;
} elsif (!($state eq "boot")) {
$callback->({error=>["Unknown state $state requested"],errorcode=>[1]});