From 6ce7c4a5ed9601f16dd45b681bf3517723b4f482 Mon Sep 17 00:00:00 2001 From: daniceexi Date: Tue, 8 Jan 2013 06:34:44 +0000 Subject: [PATCH] Make sure the hostname has been set before configure the statelite git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@14797 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- .../share/xcat/netboot/add-on/statelite/rc.statelite | 11 +++++++++++ .../netboot/add-on/statelite/rc.statelite.ppc.redhat | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/xCAT-server/share/xcat/netboot/add-on/statelite/rc.statelite b/xCAT-server/share/xcat/netboot/add-on/statelite/rc.statelite index f9696b3e7..c7fd7f76b 100755 --- a/xCAT-server/share/xcat/netboot/add-on/statelite/rc.statelite +++ b/xCAT-server/share/xcat/netboot/add-on/statelite/rc.statelite @@ -21,6 +21,17 @@ declare -a CLIST declare -a PLIST ME=`hostname -s` +MAX=30 +TRIES=1 +while [ x$ME = x ];do + TRIES=$[ $TRIES+1 ] + if [ $TRIES -eq $MAX ]; then + echo "Can NOT get the hostname of the node. System will fail to enable the persistent files.">/dev/console + break + fi + sleep 1 + ME=`hostname -s` +done PERSISTENT="${MNTDIR}/$SL/persistent/$ME" diff --git a/xCAT-server/share/xcat/netboot/add-on/statelite/rc.statelite.ppc.redhat b/xCAT-server/share/xcat/netboot/add-on/statelite/rc.statelite.ppc.redhat index 6216a37ac..20a226161 100755 --- a/xCAT-server/share/xcat/netboot/add-on/statelite/rc.statelite.ppc.redhat +++ b/xCAT-server/share/xcat/netboot/add-on/statelite/rc.statelite.ppc.redhat @@ -21,6 +21,17 @@ declare -a CLIST declare -a PLIST ME=`hostname` +MAX=30 +TRIES=1 +while [ x$ME = x ];do + TRIES=$[ $TRIES+1 ] + if [ $TRIES -eq $MAX ]; then + echo "Can NOT get the hostname of the node. System will fail to enable the persistent files.">/dev/console + break + fi + sleep 1 + ME=`hostname -s` +done PERSISTENT="${MNTDIR}/$SL/persistent/$ME"