update the nodelist.status to installing/netbooting via feedback from node during provision

This commit is contained in:
immarvin 2013-08-15 22:40:47 -07:00
parent b1d5658f5e
commit 125fb4d812

View File

@ -63,9 +63,18 @@ cat >/tmp/foo.sh <<EOF
if [ \$# -eq 0 ]; then
xcatdhost="#XCATVAR:XCATMASTER#"
xcatdport="#TABLE:site:key=xcatiport:value#"
NODESTATUS="#TABLEBLANKOKAY:site:key=nodestatus:value#"
/usr/bin/nc "\$xcatdhost" "\$xcatdport" -e /tmp/foo.sh install_monitor &
if [ -z "\$NODESTATUS" ] || [ "\$NODESTATUS" != "0" -a "\$NODESTATUS" != "N" -a "\$NODESTATUS" != "n" ];
then
/usr/bin/nc "\$xcatdhost" "\$xcatdport" -e /tmp/foo.sh installstatus installing &
fi
while true; do
/usr/bin/nc -l -p 3001 -e /tmp/foo.sh serve_client
done
@ -92,6 +101,26 @@ if [ "\$1" = "install_monitor" ]; then
exit 0
fi
#
# If the script was called with the "installstatus" argument, stdin and stdout are
# connected to an xCAT daemon on the master.
# Write the "installstatus xx" request to the daemon to update thenode installation status.
if [ "\$1" = "installstatus" ]; then
cmd=""
while [ "\$cmd" != "done" ]; do
read cmd remainder
if [ "\$cmd" == "ready" ]; then
echo "installstatus \$2"
fi
done
exit 0
fi
#
# When execution reaches here, script called with "serve_client" argument, which means
# stdin and stdout are connected to a client. Read the request from the client, provide