befc4743c4
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@4266 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
63 lines
1.4 KiB
Plaintext
63 lines
1.4 KiB
Plaintext
<post-scripts config:type="list">
|
|
<script>
|
|
<filename>xcat.sh</filename>
|
|
<interpreter>shell</interpreter>
|
|
<source>
|
|
|
|
<![CDATA[
|
|
#!/bin/sh
|
|
|
|
RAND=$(perl -e 'print int(rand(50)). "\n"')
|
|
sleep $RAND
|
|
jsi=0
|
|
while [ $(hostname) == 'linux' ]
|
|
do
|
|
if [ $jsi -gt 10 ]; then
|
|
logger "Slept too long!"
|
|
exit
|
|
fi
|
|
let jsi=jsi+1
|
|
sleep 1
|
|
done
|
|
echo "Slept $jsi seconds before hostname made sense."
|
|
|
|
HOSTNAME=$(hostname -s)
|
|
echo $HOSTNAME
|
|
|
|
/sbin/portmap
|
|
export MASTER_IP=#XCATVAR:XCATMASTER#
|
|
export MASTER_IPS=#XCATVAR:XCATMASTER#
|
|
export MASTER="#XCATVAR:XCATMASTER#"
|
|
|
|
# for servicenode, add /install to /etc/fstab
|
|
echo "$MASTER:/install /install nfs timeo=14,intr 1 2" >>/etc/fstab
|
|
|
|
# check the arch for nodetype
|
|
NODE_ARCH=#TABLE:nodetype:$NODE:arch#
|
|
|
|
cat >/etc/init.d/xcatpostinit << 'EOF'
|
|
#INCLUDE:#TABLE:site:key=installdir:value#/postscripts/xcatpostinit#
|
|
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
|
|
|
|
mkdir -p /opt/xcat
|
|
cat >/opt/xcat/xcatdsklspost << 'EOF'
|
|
#INCLUDE:#TABLE:site:key=installdir:value#/postscripts/xcatdsklspost#
|
|
chkconfig xcatpostinit off
|
|
EOF
|
|
chmod 755 /opt/xcat/xcatdsklspost
|
|
|
|
chkconfig --add xcatpostinit
|
|
|
|
cat >/opt/xcat/xcatinfo << EOF
|
|
XCATSERVER=#XCATVAR:XCATMASTER#
|
|
EOF
|
|
]]>
|
|
|
|
</source>
|
|
</script>
|
|
</post-scripts>
|