[Rocks-Discuss] No 411 Shared Key when reinstalling Nodes

379 views
Skip to first unread message

James Rudd

unread,
Mar 5, 2012, 3:45:37 PM3/5/12
to Discussion of Rocks Clusters
Good Day,
We are having a problem reinstalling nodes on our Rocks 5.4.3. When they
are reinstalled they don't appear to complete all their scripts. They don't
create a /share directory, or receive the updated /etc/passwd file from
front end.
This appears to be partially caused by not receiving
the /etc/411-security/shared.key file. (I am unsure if this is the cause or
a symptom)

If I run "411get --all" it reports an error with shared.key not found.
===============
Traceback (most recent call last):
File "/opt/rocks/bin/411get", line 214, in ?
app.run()
File "/opt/rocks/bin/411get", line 177, in run
contents, meta = self.get(file)
File "/opt/rocks/lib/python2.4/site-packages/rocks/service411.py", line
519, in get
return self.decrypt(contents)
File "/opt/rocks/lib/python2.4/site-packages/rocks/service411.py", line
710, in decrypt
self.readKeys()
File "/opt/rocks/lib/python2.4/site-packages/rocks/service411.py", line
588, in readKeys
shared_file = open(self.shared_filename, 'r')
IOError: [Errno 2] No such file or directory: '/etc/411-security/shared.key'
================

I can manually fix the problems I can see by running:
rocks sync host sharedkey compute
rocks sync users
ssh compute-?-? "mkdir /share ; service autofs start"

But this does not prevent it occurring next time or fix any problems that
may occur from not running these initial scripts. After looking through the
archive I saw a similar post that recommended running "service sec-channel
restart" but this appears to have had no effect.
http://groups.google.com/group/rocks-clusters/browse_thread/thread/f60fdb136ef23e0f/02dc6c1bb0d9a923

I have been comparing logs from nodes that have successfully reinstalled in
the past and the main difference I can find in anaconda.log is:

INFO : mountRocksDevice: found rocks device at /tmp/rocks-sda1, mounted
on /mnt/rocks-disk
ERROR : ROCKS:getCert: could not read
/mnt/rocks-disk/etc/security/cluster-cert.key,
/mnt/rocks-disk/etc/security/cluster-cert.crt, and
/mnt/rocks-disk/etc/security/cluster-ca.crt

I am unsure if this is related or just a random error. Are there any other
logs I should be looking in?

I have attached the rocks list host profile compute-0-0 for a node.

Thank you for your help,
James


James Rudd
http://jrudd.org/
---------------------
HPC Cluster Administrator
Centre of Excellence for Silicon Photovoltaics and Photonics
University of New South Wales
Sydney NSW 2052
AUSTRALIA
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.sdsc.edu/pipermail/npaci-rocks-discussion/attachments/20120306/20a2008f/attachment.html
-------------- next part --------------
<?xml version="1.0" standalone="no"?>
<profile lang="kickstart">
<section name="kickstart">
<![CDATA[
#
# Node Traversal Order
#
# ./nodes/partitions-save.xml (base)
# ./nodes/python-development.xml (base)
# ./nodes/yum.xml (base)
# ./nodes/compute-appliance.xml (base)
# ./nodes/syslog.xml (base)
# ./nodes/syslog-client.xml (base)
# ./nodes/networking-client.xml (base)
# ./nodes/node.xml (base)
# ./nodes/routes-client.xml (base)
# ./nodes/pbs-common.xml (torque)
# ./nodes/pbs-mom.xml (torque)
# ./nodes/ssl-client.xml (base)
# ./nodes/firewall.xml (base)
# ./nodes/client-firewall.xml (base)
# ./nodes/grub.xml (base)
# ./nodes/grub-client.xml (base)
# ./nodes/partition.xml (base)
# ./nodes/do-partition.xml (base)
# ./nodes/base.xml (base)
# ./nodes/411-base.xml (base)
# ./nodes/411-client.xml (base)
# ./nodes/auto-kickstart.xml (base)
# ./nodes/autofs.xml (base)
# ./nodes/benchmarks.xml (hpc)
# ./nodes/client.xml (base)
# ./nodes/dhcp-client.xml (base)
# ./nodes/disk-stamp.xml (base)
# ./nodes/foundation-base.xml (base)
# ./nodes/foundation-cpan.xml (base)
# ./nodes/ganglia.xml (ganglia)
# ./nodes/ganglia-client.xml (ganglia)
# ./nodes/greceptor.xml (base)
# ./nodes/hpc-client.xml (hpc)
# ./nodes/i18n.xml (base)
# ./nodes/ip-diag.xml (base)
# ./nodes/ipmi-base.xml (base)
# ./nodes/kernel.xml (kernel)
# ./nodes/logrotate.xml (base)
# ./nodes/mail.xml (base)
# ./nodes/mail-client.xml (base)
# ./nodes/modules-base.xml (modules)
# ./nodes/mpi.xml (hpc)
# ./nodes/node-certs.xml (base)
# ./nodes/ntp.xml (base)
# ./nodes/ntp-client.xml (base)
# ./nodes/opt-perl.xml (perl)
# ./nodes/opt-perl-cpan-support.xml (perl)
# ./nodes/opt-python.xml (python)
# ./nodes/perl-development.xml (base)
# ./nodes/resolv.xml (base)
# ./nodes/rpc.xml (base)
# ./nodes/security.xml (base)
# ./nodes/selinux.xml (base)
# ./nodes/shared-memory.xml (base)
# ./nodes/snmp-server.xml (base)
# ./nodes/ssh.xml (base)
# ./nodes/ssh-client.xml (base)
# ./nodes/ssl.xml (base)
# ./nodes/tcl-development.xml (base)
# ./nodes/postshell.xml (base)
# ./nodes/ethers-server-postshell.xml (base)
# ./nodes/pxeboot.xml (base)
# ./nodes/extend-compute.xml (unknown)
#
#
# Debugging Information
#
#

install
%include /tmp/partition-info
lang en_US
keyboard us
timezone --utc Australia/Sydney
bootloader --location=mbr
url --url http://10.1.1.1/install/rocks-dist/x86_64
interactive
rootpw --iscrypted $1$S3IxVQbt$zs86JkQcMoJtAkLyJzAtU.
%packages --ignoremissing
ClusterTools_gnu
OpenIPMI
OpenIPMI-devel
OpenIPMI-libs
OpenIPMI-perl
OpenIPMI-python
OpenIPMI-tools
PyXML
audit-libs-devel
autofs
bc
bison
compat-libf2c-34
confuse
dhclient
env-modules
expat
expect
foundation-ant
foundation-coreutils
foundation-cvs
foundation-gawk
foundation-graphviz
foundation-libxml2
foundation-mercurial
foundation-mysql
foundation-perl
foundation-perl-AppConfig
foundation-perl-Data-OptList
foundation-perl-Data-Section
foundation-perl-File-Find-Rule
foundation-perl-File-Slurp
foundation-perl-HTML-Parser
foundation-perl-HTML-Tagset
foundation-perl-List-MoreUtils
foundation-perl-Module-Signature
foundation-perl-Number-Compare
foundation-perl-Params-Util
foundation-perl-Path-Class
foundation-perl-Pod-POM
foundation-perl-Readonly
foundation-perl-Software-License
foundation-perl-Sub-Exporter
foundation-perl-Sub-Install
foundation-perl-Template-Toolkit
foundation-perl-Text-Autoformat
foundation-perl-Text-Glob
foundation-perl-Text-Reform
foundation-perl-Text-Template
foundation-perl-Tk
foundation-perl-URI
foundation-perl-YAML
foundation-perl-libwww-perl
foundation-python
foundation-python-extras
foundation-python-xml
foundation-rcs
foundation-readline
foundation-redhat
foundation-wget
ganglia-monitor-core
ganglia-pylib
ganglia-python
ganglia-receptor
gcc
glibc-devel
grub
iozone
iperf
iputils
jdk
kernel-devel
kernel-doc
kernel-headers
libcap
libdhcp-devel
libdnet
libgcc
libgfortran
libobjc
librocks
lsof
mpi-tests
mpich2-ethernet-gnu
mpiexec
net-snmp
nspr.x86_64
ntp
openmpi
openmpi-devel
openmpi-libs
openssh
openssh-askpass
openssh-clients
openssh-server
openssl
openssl
opt-numpy
opt-perl
opt-perl-AppConfig
opt-perl-Data-OptList
opt-perl-Data-Section
opt-perl-Encode-Locale
opt-perl-File-Find-Rule
opt-perl-File-Listing
opt-perl-File-Slurp
opt-perl-HTML-Parser
opt-perl-HTML-Tagset
opt-perl-HTTP-Cookies
opt-perl-HTTP-Daemon
opt-perl-HTTP-Date
opt-perl-HTTP-Message
opt-perl-HTTP-Negotiate
opt-perl-IPC-Run
opt-perl-LWP-MediaTypes
opt-perl-List-MoreUtils
opt-perl-MRO-Compat
opt-perl-Module-Signature
opt-perl-Net-HTTP
opt-perl-Number-Compare
opt-perl-Params-Util
opt-perl-Path-Class
opt-perl-Pod-POM
opt-perl-Readonly
opt-perl-Software-License
opt-perl-Sub-Exporter
opt-perl-Sub-Install
opt-perl-Template-Toolkit
opt-perl-Text-Autoformat
opt-perl-Text-Glob
opt-perl-Text-Reform
opt-perl-Text-Template
opt-perl-Tk
opt-perl-URI
opt-perl-WWW-RobotRules
opt-perl-YAML
opt-perl-libwww-perl
opt-python-27
opt-python-3
pbs-rocks
pbs_python
pbstools
perl
phpsysinfo
portmap
postfix
python
python-devel
rcs
rdate
redhat-rpm-config
rocks-411
rocks-boot
rocks-boot-auto
rocks-boot-xen
rocks-channel
rocks-command
rocks-config
rocks-cpan
rocks-cpan
rocks-ganglia
rocks-openmpi
rocks-pylib
rocks-sec-channel-client
rocks-ssl
roll-perl-usersguide
roll-python-usersguide
rpm-build
sharutils
stream
sudo
sunct-extra
sysstat
tcl
tcpdump
tcsh
tentakel
torque
torque-openmpi
usermode
xorg-x11-xauth
yum

%pre --log=/tmp/ks-pre.log

if [ ! -f /tmp/user_partition_info ]
then
echo "rocks force-default-root-disk-only" > /tmp/user_partition_info
fi
%pre --log=/tmp/ks-pre.log

if [ ! -f /tmp/RCS/db_partition_info.py,v ]; then
if [ ! -f /tmp/db_partition_info.py ]; then
touch /tmp/db_partition_info.py;
fi
if [ ! -d /tmp/RCS ]; then
mkdir -m 700 /tmp/RCS
chown 0:0 /tmp/RCS
fi;
echo "original" | /opt/rocks/bin/ci /tmp/db_partition_info.py;
/opt/rocks/bin/co -f -l /tmp/db_partition_info.py;
fi
cat > /tmp/db_partition_info.py << 'EOF'
RocksVersion = '5.4.3'
RocksRelease = 'Viper'
KickstartHost = '10.1.1.1'

dbpartinfo = {'sda': [('sda1', '32.3kB', '16.8GB', '', 'ext3', 'boot', '', '/'), ('sda2', '16.8GB', '4195MB', '', 'ext3', '', '', '/var'), ('sda3', '21.0GB', '1045MB', '', 'linux-swap', '', '', 'swap'), ('sda4', '22.0GB', '138GB', '', '', '', '', ''), ('sda5', '22.0GB', '138GB', '', 'ext3', '', '', '/state/partition1')]}

EOF


chmod a+x /tmp/product/do_partition.py
%pre --log=/tmp/ks-pre.log

if [ -f /tmp/authorized_keys ]
then
exit
fi

cat > /tmp/authorized_keys << 'EOF'
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAt/mlYPuqfoNYKcDBT3+NnIlv+lV2dkVz1+9zxa3J0FbfI2VFvI1+OZzVk72wgIGH7nNU1RiO2rJ6cxNi2zYLBFcgwwwuqzN0T2OW2Edq4LpJGJVVn9Q3tRIxXDKCZAey4x2RZHxO508EVT5QdFHoylUQqLaE8utsHG22XlHtHhs/zdfag3vc7J7eAMDJsSuvUbplEXFs2le6g/GKVmAmInjo8g2EzHLOEL4c1nBAzdaS0iVxZ8wKsxrKnUKLi+o5HqC4LyZuxxvxDIPhmxxvoEKwb1XxQFO0+307/490G04KJnqvB/1ka3s/m5LWKjOdfmuxbgwmkFB53wlve0UtPQ== ro...@fyr.pvcentre.pv.unsw.edu.au
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAt/mlYPuqfoNYKcDBT3+NnIlv+lV2dkVz1+9zxa3J0FbfI2VFvI1+OZzVk72wgIGH7nNU1RiO2rJ6cxNi2zYLBFcgwwwuqzN0T2OW2Edq4LpJGJVVn9Q3tRIxXDKCZAey4x2RZHxO508EVT5QdFHoylUQqLaE8utsHG22XlHtHhs/zdfag3vc7J7eAMDJsSuvUbplEXFs2le6g/GKVmAmInjo8g2EzHLOEL4c1nBAzdaS0iVxZ8wKsxrKnUKLi+o5HqC4LyZuxxvxDIPhmxxvoEKwb1XxQFO0+307/490G04KJnqvB/1ka3s/m5LWKjOdfmuxbgwmkFB53wlve0UtPQ== ro...@fyr.pvcentre.pv.unsw.edu.au

EOF

chmod 600 /tmp/authorized_keys
%pre --log=/tmp/ks-pre.log


cd /tmp/updates
cp -r pixmaps /tmp/product/
%pre --log=/tmp/ks-pre.log

touch /tmp/rocks-skip-welcome

%post --log=/mnt/sysimage/var/log/rocks-install.log


if [ ! -f /var/log/RCS/rocks-install.log,v ]; then
if [ ! -f /var/log/rocks-install.log ]; then
touch /var/log/rocks-install.log;
fi
if [ ! -d /var/log/RCS ]; then
mkdir -m 700 /var/log/RCS
chown 0:0 /var/log/RCS
fi;
echo "original" | /opt/rocks/bin/ci /var/log/rocks-install.log;
/opt/rocks/bin/co -f -l /var/log/rocks-install.log;
fi
cat >> /var/log/rocks-install.log << 'EOF'
./nodes/partitions-save.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log --nochroot

chmod a+x /tmp/product/record_partitions.py
/tmp/product/record_partitions.py
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/partitions-save.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/yum.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log

if [ ! -f /etc/RCS/yum.conf,v ]; then
if [ ! -f /etc/yum.conf ]; then
touch /etc/yum.conf;
fi
if [ ! -d /etc/RCS ]; then
mkdir -m 700 /etc/RCS
chown 0:0 /etc/RCS
fi;
echo "original" | /opt/rocks/bin/ci /etc/yum.conf;
/opt/rocks/bin/co -f -l /etc/yum.conf;
fi
cat > /etc/yum.conf << 'EOF'
[main]
cachedir=/var/cache/yum
debuglevel=2
logfile=/var/log/yum.log
pkgpolicy=newest
distroverpkg=redhat-release
tolerant=1
exactarch=1
assumeyes=1

[Rocks-5.4.3]
name=Rocks 5.4.3
baseurl=http://129.94.216.251/install/rocks-dist/x86_64
EOF


rm -f /etc/yum.repos.d/*repo
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/yum.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/compute-appliance.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log

if [ ! -f /etc/RCS/motd,v ]; then
if [ ! -f /etc/motd ]; then
touch /etc/motd;
fi
if [ ! -d /etc/RCS ]; then
mkdir -m 700 /etc/RCS
chown 0:0 /etc/RCS
fi;
echo "original" | /opt/rocks/bin/ci /etc/motd;
/opt/rocks/bin/co -f -l /etc/motd;
fi
cat >> /etc/motd << 'EOF'
Rocks Compute Node
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/compute-appliance.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/syslog.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


if [ ! -f /etc/RCS/syslog.conf,v ]; then
if [ ! -f /etc/syslog.conf ]; then
touch /etc/syslog.conf;
fi
if [ ! -d /etc/RCS ]; then
mkdir -m 700 /etc/RCS
chown 0:0 /etc/RCS
fi;
echo "original" | /opt/rocks/bin/ci /etc/syslog.conf;
/opt/rocks/bin/co -f -l /etc/syslog.conf;
fi
cat > /etc/syslog.conf << 'EOF'
*.err /var/log/messages
auth.info /var/log/auth
authpriv.info /var/log/authpriv
cron.err /var/log/cron
daemon.info /var/log/daemon
kern.err /var/log/kern
lpr.err /var/log/lpr
mail.info /var/log/maillog
news.info /var/log/news
syslog.err /var/log/syslog
user.err /var/log/user
local0.* /var/log/local0
local1.* /var/log/local1
local2.* /var/log/local2
local3.* /var/log/local3
local4.* /var/log/local4
local5.* /var/log/local5
local6.* /var/log/local6
local7.* /var/log/local7
EOF


if [ ! -f /var/log/RCS/boot.log,v ]; then
if [ ! -f /var/log/boot.log ]; then
touch /var/log/boot.log;
fi
if [ ! -d /var/log/RCS ]; then
mkdir -m 700 /var/log/RCS
chown 0:0 /var/log/RCS
fi;
echo "original" | /opt/rocks/bin/ci /var/log/boot.log;
/opt/rocks/bin/co -f -l /var/log/boot.log;
fi
touch /var/log/boot.log


/sbin/chkconfig rocks-dmesg on
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/syslog.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/syslog.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/syslog.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/syslog-client.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log

cat >> /etc/syslog.conf << 'EOF'
*.info @10.1.1.1
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/syslog-client.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/networking-client.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


error - must supply one host
{host} {iface} [iface=string] [ip=string] [mac=string] [module=string] [name=string] [subnet=string] [vlan=string]
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/networking-client.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/networking-client.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log

if [ ! -f /etc/sysconfig/RCS/network,v ]; then
if [ ! -f /etc/sysconfig/network ]; then
touch /etc/sysconfig/network;
fi
if [ ! -d /etc/sysconfig/RCS ]; then
mkdir -m 700 /etc/sysconfig/RCS
chown 0:0 /etc/sysconfig/RCS
fi;
echo "original" | /opt/rocks/bin/ci /etc/sysconfig/network;
/opt/rocks/bin/co -f -l /etc/sysconfig/network;
fi
cat > /etc/sysconfig/network << 'EOF'
NETWORKING=yes
HOSTNAME=compute-0-0.local
GATEWAY=10.1.1.1
EOF


if [ ! -f /etc/sysconfig/network-scripts/RCS/ifcfg-eth2,v ]; then
if [ ! -f /etc/sysconfig/network-scripts/ifcfg-eth2 ]; then
touch /etc/sysconfig/network-scripts/ifcfg-eth2;
fi
if [ ! -d /etc/sysconfig/network-scripts/RCS ]; then
mkdir -m 700 /etc/sysconfig/network-scripts/RCS
chown 0:0 /etc/sysconfig/network-scripts/RCS
fi;
echo "original" | /opt/rocks/bin/ci /etc/sysconfig/network-scripts/ifcfg-eth2;
/opt/rocks/bin/co -f -l /etc/sysconfig/network-scripts/ifcfg-eth2;
fi
cat > /etc/sysconfig/network-scripts/ifcfg-eth2 << 'EOF'
DEVICE=eth2
HWADDR=00:22:19:0e:f6:52
IPADDR=10.1.255.254
NETMASK=255.255.0.0
BOOTPROTO=static
ONBOOT=yes
MTU=1500
EOF


if [ ! -f /etc/sysconfig/network-scripts/RCS/ifcfg-eth0,v ]; then
if [ ! -f /etc/sysconfig/network-scripts/ifcfg-eth0 ]; then
touch /etc/sysconfig/network-scripts/ifcfg-eth0;
fi
if [ ! -d /etc/sysconfig/network-scripts/RCS ]; then
mkdir -m 700 /etc/sysconfig/network-scripts/RCS
chown 0:0 /etc/sysconfig/network-scripts/RCS
fi;
echo "original" | /opt/rocks/bin/ci /etc/sysconfig/network-scripts/ifcfg-eth0;
/opt/rocks/bin/co -f -l /etc/sysconfig/network-scripts/ifcfg-eth0;
fi
cat > /etc/sysconfig/network-scripts/ifcfg-eth0 << 'EOF'
DEVICE=eth0
HWADDR=00:15:17:96:89:62
BOOTPROTO=none
ONBOOT=no
MTU=1500
EOF


if [ ! -f /etc/sysconfig/network-scripts/RCS/ifcfg-eth1,v ]; then
if [ ! -f /etc/sysconfig/network-scripts/ifcfg-eth1 ]; then
touch /etc/sysconfig/network-scripts/ifcfg-eth1;
fi
if [ ! -d /etc/sysconfig/network-scripts/RCS ]; then
mkdir -m 700 /etc/sysconfig/network-scripts/RCS
chown 0:0 /etc/sysconfig/network-scripts/RCS
fi;
echo "original" | /opt/rocks/bin/ci /etc/sysconfig/network-scripts/ifcfg-eth1;
/opt/rocks/bin/co -f -l /etc/sysconfig/network-scripts/ifcfg-eth1;
fi
cat > /etc/sysconfig/network-scripts/ifcfg-eth1 << 'EOF'
DEVICE=eth1
HWADDR=00:15:17:96:89:63
BOOTPROTO=none
ONBOOT=no
MTU=1500
EOF


if [ ! -f /etc/sysconfig/network-scripts/RCS/ifcfg-eth3,v ]; then
if [ ! -f /etc/sysconfig/network-scripts/ifcfg-eth3 ]; then
touch /etc/sysconfig/network-scripts/ifcfg-eth3;
fi
if [ ! -d /etc/sysconfig/network-scripts/RCS ]; then
mkdir -m 700 /etc/sysconfig/network-scripts/RCS
chown 0:0 /etc/sysconfig/network-scripts/RCS
fi;
echo "original" | /opt/rocks/bin/ci /etc/sysconfig/network-scripts/ifcfg-eth3;
/opt/rocks/bin/co -f -l /etc/sysconfig/network-scripts/ifcfg-eth3;
fi
cat > /etc/sysconfig/network-scripts/ifcfg-eth3 << 'EOF'
DEVICE=eth3
HWADDR=00:22:19:0e:f6:53
BOOTPROTO=none
ONBOOT=no
MTU=1500
EOF


if [ ! -f /etc/sysconfig/RCS/ipmi,v ]; then
if [ ! -f /etc/sysconfig/ipmi ]; then
touch /etc/sysconfig/ipmi;
fi
if [ ! -d /etc/sysconfig/RCS ]; then
mkdir -m 700 /etc/sysconfig/RCS
chown 0:0 /etc/sysconfig/RCS
fi;
echo "original" | /opt/rocks/bin/ci /etc/sysconfig/ipmi;
/opt/rocks/bin/co -f -l /etc/sysconfig/ipmi;
fi
chmod 500 /etc/sysconfig/ipmi
cat > /etc/sysconfig/ipmi << 'EOF'
IPMI_SI=yes
DEV_IPMI=yes
IPMI_WATCHDOG=no
IPMI_WATCHDOG_OPTIONS="timeout=60"
IPMI_POWEROFF=no
IPMI_POWERCYCLE=no
IPMI_IMB=no
ipmitool lan set 1 ipaddr 10.2.255.254
ipmitool lan set 1 netmask 255.255.0.0
ipmitool lan set 1 arp respond on
ipmitool user set password 1 admin
ipmitool lan set 1 access on
ipmitool lan set 1 user
ipmitool lan set 1 auth ADMIN PASSWORD
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/networking-client.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/node.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log

for i in gpm kudzu keytable cups apmd linuxconf identd pcmcia rhnsd xfs \
lpd restorecond mcstrans bluetooth hidd yum-updatesd avahi-daemon \
pcscd ; do
if [ -f /etc/rc.d/init.d/$i ]; then
/sbin/chkconfig $i off
fi
done

gawk '/net\.ipv4\.ip_forward/ { \
printf("net.ipv4.ip_forward = 1\n"); \
next; \
} \
{ print $0 }' /etc/sysctl.conf > /tmp/sysctl.conf
mv /tmp/sysctl.conf /etc/sysctl.conf


if [ ! -f /etc/RCS/man.config,v ]; then
if [ ! -f /etc/man.config ]; then
touch /etc/man.config;
fi
if [ ! -d /etc/RCS ]; then
mkdir -m 700 /etc/RCS
chown 0:0 /etc/RCS
fi;
echo "original" | /opt/rocks/bin/ci /etc/man.config;
/opt/rocks/bin/co -f -l /etc/man.config;
fi
cat >> /etc/man.config << 'EOF'
MANPATH /opt/rocks/man
EOF

if [ -d /opt/x86-libs ]
then
(cd /opt/x86-libs; \
find | cpio -pdu /)
/sbin/ldconfig
fi
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/node.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/node.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


if [ ! -f /etc/RCS/ld.so.conf,v ]; then
if [ ! -f /etc/ld.so.conf ]; then
touch /etc/ld.so.conf;
fi
if [ ! -d /etc/RCS ]; then
mkdir -m 700 /etc/RCS
chown 0:0 /etc/RCS
fi;
echo "original" | /opt/rocks/bin/ci /etc/ld.so.conf;
/opt/rocks/bin/co -f -l /etc/ld.so.conf;
fi
cat >> /etc/ld.so.conf << 'EOF'
/lib64
/usr/lib64
/usr/kerberos/lib64
/opt/nmi/lib
/usr/lib64/qt-3.1/lib
/usr/lib64/mysql
/usr/X11R6/lib64
EOF


/sbin/ldconfig
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/node.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/node.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/node.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/routes-client.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log

if [ ! -f /etc/sysconfig/RCS/static-routes,v ]; then
if [ ! -f /etc/sysconfig/static-routes ]; then
touch /etc/sysconfig/static-routes;
fi
if [ ! -d /etc/sysconfig/RCS ]; then
mkdir -m 700 /etc/sysconfig/RCS
chown 0:0 /etc/sysconfig/RCS
fi;
echo "original" | /opt/rocks/bin/ci /etc/sysconfig/static-routes;
/opt/rocks/bin/co -f -l /etc/sysconfig/static-routes;
fi
cat > /etc/sysconfig/static-routes << 'EOF'
any host 129.94.216.251 gw 10.1.1.1
any net 224.0.0.0 netmask 255.255.255.0 dev eth2
any host 255.255.255.255 dev eth2
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/routes-client.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/pbs-common.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log

if [ ! -f /opt/torque/RCS/server_name,v ]; then
if [ ! -f /opt/torque/server_name ]; then
touch /opt/torque/server_name;
fi
if [ ! -d /opt/torque/RCS ]; then
mkdir -m 700 /opt/torque/RCS
chown 0:0 /opt/torque/RCS
fi;
echo "original" | /opt/rocks/bin/ci /opt/torque/server_name;
/opt/rocks/bin/co -f -l /opt/torque/server_name;
fi
cat > /opt/torque/server_name << 'EOF'
fyr.pvcentre.pv.unsw.edu.au
EOF


/sbin/chkconfig pbs off
/sbin/chkconfig --del pbs


cat >> /etc/man.config << 'EOF'
MANPATH /opt/torque/man
EOF


# Changes for big clusters

if [ ! -f /etc/security/RCS/limits.conf,v ]; then
if [ ! -f /etc/security/limits.conf ]; then
touch /etc/security/limits.conf;
fi
if [ ! -d /etc/security/RCS ]; then
mkdir -m 700 /etc/security/RCS
chown 0:0 /etc/security/RCS
fi;
echo "original" | /opt/rocks/bin/ci /etc/security/limits.conf;
/opt/rocks/bin/co -f -l /etc/security/limits.conf;
fi
cat >> /etc/security/limits.conf << 'EOF'
* - memlock -1
* - stack -1
* - nofile 4096
EOF

# these are also needed in the pbs startup scripts.
# just hack them into the beginning
sed -i -e 27i"ulimit -l unlimited" /etc/init.d/pbs
sed -i -e 27i"ulimit -s unlimited" /etc/init.d/pbs
sed -i -e 27i"ulimit -n 4096" /etc/init.d/pbs

if [ ! -f /etc/RCS/sysctl.conf,v ]; then
if [ ! -f /etc/sysctl.conf ]; then
touch /etc/sysctl.conf;
fi
if [ ! -d /etc/RCS ]; then
mkdir -m 700 /etc/RCS
chown 0:0 /etc/RCS
fi;
echo "original" | /opt/rocks/bin/ci /etc/sysctl.conf;
/opt/rocks/bin/co -f -l /etc/sysctl.conf;
fi
cat >> /etc/sysctl.conf << 'EOF'
fs.file-max = 65536
#recommended values for large cluster from clusterresources.com
# Don't allow the arp table to become bigger than this
net.ipv4.neigh.default.gc_thresh3 = 4096
# Tell the gc when to become aggressive with arp table cleaning.
# Adjust this based on size of the LAN.
net.ipv4.neigh.default.gc_thresh2 = 2048
# Adjust where the gc will leave arp table alone
net.ipv4.neigh.default.gc_thresh1 = 1024
# Adjust to arp table gc to clean-up more often
net.ipv4.neigh.default.gc_interval = 3600
# ARP cache entry timeout
net.ipv4.neigh.default.gc_stale_time = 3600
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/pbs-common.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/pbs-mom.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log

cat > /opt/torque/mom_priv/config << 'EOF'
$pbsserver fyr.local
$usecp fyr.pvcentre.pv.unsw.edu.au:/home /home
EOF


if [ ! -f /etc/RCS/pbs.conf,v ]; then
if [ ! -f /etc/pbs.conf ]; then
touch /etc/pbs.conf;
fi
if [ ! -d /etc/RCS ]; then
mkdir -m 700 /etc/RCS
chown 0:0 /etc/RCS
fi;
echo "original" | /opt/rocks/bin/ci /etc/pbs.conf;
/opt/rocks/bin/co -f -l /etc/pbs.conf;
fi
cat > /etc/pbs.conf << 'EOF'
pbs_home=/opt/torque
pbs_exec=/opt/torque
start_mom=1
start_sched=0
start_server=0
EOF

/sbin/chkconfig --add pbs
/sbin/service pbs start
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/pbs-mom.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/ssl-client.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


if [ ! -f /etc/pki/tls/private/RCS/localhost.key,v ]; then
if [ ! -f /etc/pki/tls/private/localhost.key ]; then
touch /etc/pki/tls/private/localhost.key;
fi
if [ ! -d /etc/pki/tls/private/RCS ]; then
mkdir -m 700 /etc/pki/tls/private/RCS
chown 0:0 /etc/pki/tls/private/RCS
fi;
echo "original" | /opt/rocks/bin/ci /etc/pki/tls/private/localhost.key;
/opt/rocks/bin/co -f -l /etc/pki/tls/private/localhost.key;
fi
chmod 0400 /etc/pki/tls/private/localhost.key
cat > /etc/pki/tls/private/localhost.key << 'EOF'
-----BEGIN RSA PRIVATE KEY-----
MIICXgIBAAKBgQCyPRheTO1kAXCShRN3Tt5BexPI9WmswMC5H4cNetixmo1YUlAo
pnmQZnFjBH5Pxsf0TNm0h8SmoRnm6c8pVhSFazwz3RIt55sN8z8GuWST/DSOY8c4
VDElKsBZPGTNBgAQfwZS+B3TtuybX+1UZjlnSAcqB5MEnj5A1+op9eun0wIDAQAB
AoGBAJqwZ2vAO+8lSLwA/sn3CvGtjZhFVXd2ukxwTlemnFZXmgBjP+pnwO1P22xi
Q/WcwYEHCZKimks7Wi2MEhz/9kH5pU4VimJQ7ANzfOwlvHUVk5jHu5bb0W2Il1nv
Ubcuno69YtokHm0toaNE+dGx85U5JLN3oFjpnfEdLIAEuOnhAkEA3iMdA8IqVcRm
AoB4JXv/7yqSAQKnVCG1kg3KSLe/OyysLo6yeHJ1mlIVTI8AoC+ClmnglyRIaDjw
MlCcHa/gaQJBAM1o2IIVcLyYXxUsMxcdaiy9cU/s8gqeNxVk9hBGqoB0Zkk0acgo
YLHpWQc8/ae3EC2IT2NKdv825KqLIw+LftsCQQCh62Br6+1mBToCWti5IhDlqdcx
S1jjF4s9gjXQGbgYDzEW4scuyuf0bB7AZoCjQt5ie5zNLxJkfhR/6IhTj275AkEA
tQwIaP/E0jXq+JpwnZsLjkubqDrMS5eQLYdDaq0ecwIldbiA1C7iq21lTv/vAvhT
hg5zCq0DnYcgnUDtsjHdqQJADbSb6/K0E839REDXPeEvErS8KUUZXsJexuaPHu3z
2fj1wq79oWxKJFXANeH/eb/vsbDm+kSOamlrFaU094Fc/A==
-----END RSA PRIVATE KEY-----
EOF


if [ ! -f /etc/pki/tls/certs/RCS/localhost.crt,v ]; then
if [ ! -f /etc/pki/tls/certs/localhost.crt ]; then
touch /etc/pki/tls/certs/localhost.crt;
fi
if [ ! -d /etc/pki/tls/certs/RCS ]; then
mkdir -m 700 /etc/pki/tls/certs/RCS
chown 0:0 /etc/pki/tls/certs/RCS
fi;
echo "original" | /opt/rocks/bin/ci /etc/pki/tls/certs/localhost.crt;
/opt/rocks/bin/co -f -l /etc/pki/tls/certs/localhost.crt;
fi
chmod 0444 /etc/pki/tls/certs/localhost.crt
cat > /etc/pki/tls/certs/localhost.crt << 'EOF'
-----BEGIN CERTIFICATE-----
MIIC9zCCAmACAQkwDQYJKoZIhvcNAQEFBQAwgd4xODA2BgNVBAoTL1NjaG9vbCBv
ZiBQaG90b3ZvbHRhaWMgYW5kIFJlbmV3YWJsZSBFbmVyZ3kgRW5nMQ8wDQYDVQQL
EwZGeXItQ0ExJzAlBgkqhkiG9w0BCQEWGGV2YXR0Lmhhd2tlc0B1bnN3LmVkdS5h
dTEkMCIGA1UEBxMbVHlyZWUgRW5lcmd5IEJ1aWxkaW5nLCBVTlNXMQ8wDQYDVQQI
EwZTeWRuZXkxCzAJBgNVBAYTAkFVMSQwIgYDVQQDExtmeXIucHZjZW50cmUucHYu
dW5zdy5lZHUuYXUwHhcNMTIwMzA1MjAzODU3WhcNMTQxMTMwMjAzODU3WjCBqDEL
MAkGA1UEBhMCQVUxDzANBgNVBAgTBlN5ZG5leTEkMCIGA1UEBxMbVHlyZWUgRW5l
cmd5IEJ1aWxkaW5nLCBVTlNXMTgwNgYDVQQKEy9TY2hvb2wgb2YgUGhvdG92b2x0
YWljIGFuZCBSZW5ld2FibGUgRW5lcmd5IEVuZzEMMAoGA1UECxMDRnlyMRowGAYD
VQQDExFjb21wdXRlLTAtMC5sb2NhbDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkC
gYEAsj0YXkztZAFwkoUTd07eQXsTyPVprMDAuR+HDXrYsZqNWFJQKKZ5kGZxYwR+
T8bH9EzZtIfEpqEZ5unPKVYUhWs8M90SLeebDfM/Brlkk/w0jmPHOFQxJSrAWTxk
zQYAEH8GUvgd07bsm1/tVGY5Z0gHKgeTBJ4+QNfqKfXrp9MCAwEAATANBgkqhkiG
9w0BAQUFAAOBgQBZU8pUwxlsAqB2l9AaSzBU130SiyAOTnMDCmtNqCISaPLUH29L
VBtADhkxytVgFgL0hbHrm/M8/i4WWEx3zGssKI94Vr/CZpCRDKsQ0eLLXzUCPF76
m3sAT7JTH9CBc1y2ZYtwTRhw0OnwaCCqt8gc361PZ8BdENA+GEm/p9kDUQ==
-----END CERTIFICATE-----
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/ssl-client.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/ssl-client.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/ssl-client.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/firewall.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log

/sbin/chkconfig iptables on

/sbin/chkconfig ip6tables off
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/firewall.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/client-firewall.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log

if [ ! -f /etc/sysconfig/RCS/iptables,v ]; then
if [ ! -f /etc/sysconfig/iptables ]; then
touch /etc/sysconfig/iptables;
fi
if [ ! -d /etc/sysconfig/RCS ]; then
mkdir -m 700 /etc/sysconfig/RCS
chown 0:0 /etc/sysconfig/RCS
fi;
echo "original" | /opt/rocks/bin/ci /etc/sysconfig/iptables;
/opt/rocks/bin/co -f -l /etc/sysconfig/iptables;
fi
chmod 500 /etc/sysconfig/iptables
cat > /etc/sysconfig/iptables << 'EOF'
*filter
:INPUT ACCEPT [0:0]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [0:0]
# A15-ALL-LOCAL (global) :
-A INPUT -i lo -j ACCEPT
# A20-ALL-PRIVATE (global) :
-A INPUT -i eth2 -j ACCEPT
COMMIT
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/client-firewall.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/grub.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


if [ ! -f /tmp/RCS/grub.conf,v ]; then
if [ ! -f /tmp/grub.conf ]; then
touch /tmp/grub.conf;
fi
if [ ! -d /tmp/RCS ]; then
mkdir -m 700 /tmp/RCS
chown 0:0 /tmp/RCS
fi;
echo "original" | /opt/rocks/bin/ci /tmp/grub.conf;
/opt/rocks/bin/co -f -l /tmp/grub.conf;
fi
grep -v splashimage /boot/grub/grub.conf > /tmp/grub.conf
touch /tmp/grub.conf

mv /tmp/grub.conf /boot/grub/grub.conf


cp /boot/grub/grub.conf /boot/grub/grub-orig.conf
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/grub.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/grub-client.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log --interpreter /opt/rocks/bin/python

import os
import os.path
import rocks.grub

isXen = False
detectXen1 = '/sbin/lsmod | /bin/grep xen'
detectXen2 = '/sbin/lspci'

for mods in os.popen(detectXen1).readlines():
isXen = True

for devs in os.popen(detectXen2).readlines():
isXen = False

if isXen:
#
# reinstall a virtual machine
#
makegrub = rocks.grub.App()

makegrub.setBootTitle('Rocks Reinstall Xen')
makegrub.setInstallKernel(
'kickstart/xen/vmlinuz-5.4.3-x86_64')
makegrub.setInstallRamdisk(
'kickstart/xen/initrd-xen.iso.gz-5.4.3-x86_64')

args = "ks initrd=initrd.img-5.4.3-x86_64 pxe selinux=0 "
args += "noipv6 lang= devfs=nomount"

makegrub.run(args)
else:
#
# reinstall a physical machine
#
makegrub = rocks.grub.App()

makegrub.setInstallKernel(
'kickstart/default/vmlinuz-5.4.3-x86_64')
makegrub.setInstallRamdisk(
'kickstart/default/initrd.img-5.4.3-x86_64')

args = "ks selinux=0"
makegrub.run(args)

newmakegrub = rocks.grub.App()

#
# and set the boot flags for a physical machine
#
args = ""


newmakegrub.setBootTitle('title')

#
# set the bootflags for both the grub.conf and grub-orig.conf files
#
newmakegrub.setFilename('grub.conf')
newmakegrub.append(args)

newmakegrub.setFilename('grub-orig.conf')
newmakegrub.append(args)
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/grub-client.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/base.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log

/sbin/chkconfig rocks-pre on
/sbin/chkconfig rocks-post on
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/base.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/base.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log

if [ ! -f /etc/RCS/inittab,v ]; then
if [ ! -f /etc/inittab ]; then
touch /etc/inittab;
fi
if [ ! -d /etc/RCS ]; then
mkdir -m 700 /etc/RCS
chown 0:0 /etc/RCS
fi;
echo "original" | /opt/rocks/bin/ci /etc/inittab;
/opt/rocks/bin/co -f -l /etc/inittab;
fi
cat >> /etc/inittab << 'EOF'
bw::bootwait:/etc/rc.d/rc.rocksconfig before-rc
po:35:wait:/etc/rc.d/rc.rocksconfig after-rc
EOF


cat >> /etc/motd << 'EOF'
Rocks 5.4.3 (Viper)
Profile built 07:38 06-Mar-2012

EOF

cat >> /etc/motd << EOF
Kickstarted `date +"%H:%M %d-%b-%Y"`
EOF

if [ ! -f /var/cluster/RCS/born-on,v ]; then
if [ ! -f /var/cluster/born-on ]; then
touch /var/cluster/born-on;
fi
if [ ! -d /var/cluster/RCS ]; then
mkdir -m 700 /var/cluster/RCS
chown 0:0 /var/cluster/RCS
fi;
echo "original" | /opt/rocks/bin/ci /var/cluster/born-on;
/opt/rocks/bin/co -f -l /var/cluster/born-on;
fi
cat > /var/cluster/born-on << 'EOF'
07:38:57 06-Mar-2012
1330979937.7696660

EOF


serviceList=""
if [ "x" == "x" ]; then
serviceList="kudzu canna cWnn FreeWnn kWnn tWnn mDNSResponder"
fi

for i in $serviceList
do
if [ -f /etc/rc.d/init.d/$i ]; then
/sbin/chkconfig $i off
fi
done


if [ ! -f /etc/sysconfig/RCS/i18n,v ]; then
if [ ! -f /etc/sysconfig/i18n ]; then
touch /etc/sysconfig/i18n;
fi
if [ ! -d /etc/sysconfig/RCS ]; then
mkdir -m 700 /etc/sysconfig/RCS
chown 0:0 /etc/sysconfig/RCS
fi;
echo "original" | /opt/rocks/bin/ci /etc/sysconfig/i18n;
/opt/rocks/bin/co -f -l /etc/sysconfig/i18n;
fi
cat > /etc/sysconfig/i18n << 'EOF'
LANG="en_US.iso885915"
SYSFONT="lat0-sun16"
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/base.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/base.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log

chmod a+rwx /state/partition*
chmod o+t /state/partition*
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/base.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/base.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log

if [ ! -f /etc/rpm/RCS/macros.rocks,v ]; then
if [ ! -f /etc/rpm/macros.rocks ]; then
touch /etc/rpm/macros.rocks;
fi
if [ ! -d /etc/rpm/RCS ]; then
mkdir -m 700 /etc/rpm/RCS
chown 0:0 /etc/rpm/RCS
fi;
echo "original" | /opt/rocks/bin/ci /etc/rpm/macros.rocks;
/opt/rocks/bin/co -f -l /etc/rpm/macros.rocks;
fi
chmod 0644 /etc/rpm/macros.rocks
cat > /etc/rpm/macros.rocks << 'EOF'
%distribution Rocks

%debug_package %{nil}
%_without_check 0
%_unpackaged_files_terminate_build 0
%_missing_doc_files_terminate_build 0
%__vsflags 0xc0c00
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/base.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/base.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log

rm -f /usr/bin/java


cat >> /etc/man.config << 'EOF'
MANPATH /usr/java/latest/man
EOF

if [ ! -f /etc/profile.d/RCS/java.sh,v ]; then
if [ ! -f /etc/profile.d/java.sh ]; then
touch /etc/profile.d/java.sh;
fi
if [ ! -d /etc/profile.d/RCS ]; then
mkdir -m 700 /etc/profile.d/RCS
chown 0:0 /etc/profile.d/RCS
fi;
echo "original" | /opt/rocks/bin/ci /etc/profile.d/java.sh;
/opt/rocks/bin/co -f -l /etc/profile.d/java.sh;
fi
chmod 0755 /etc/profile.d/java.sh
cat > /etc/profile.d/java.sh << 'EOF'
export JAVA_HOME=/usr/java/latest
export PATH=$JAVA_HOME/bin:$PATH
EOF

if [ ! -f /etc/profile.d/RCS/java.csh,v ]; then
if [ ! -f /etc/profile.d/java.csh ]; then
touch /etc/profile.d/java.csh;
fi
if [ ! -d /etc/profile.d/RCS ]; then
mkdir -m 700 /etc/profile.d/RCS
chown 0:0 /etc/profile.d/RCS
fi;
echo "original" | /opt/rocks/bin/ci /etc/profile.d/java.csh;
/opt/rocks/bin/co -f -l /etc/profile.d/java.csh;
fi
chmod 0755 /etc/profile.d/java.csh
cat > /etc/profile.d/java.csh << 'EOF'
setenv JAVA_HOME /usr/java/latest
set path = ($JAVA_HOME/bin $path)
EOF



for i in `find -L /usr/java/latest -name 'libnpjp2*so'`; do
echo $i | grep 64 > /dev/null
if [ $? = 0 ]; then
MOZPATH=/usr/lib64/mozilla/plugins
else
MOZPATH=/usr/lib/mozilla/plugins
fi

if [ -d $MOZPATH ]; then
ln -s $i $MOZPATH
fi
done
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/base.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/base.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/base.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/base.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


if [ ! -f /tmp/RCS/mdmonitor,v ]; then
if [ ! -f /tmp/mdmonitor ]; then
touch /tmp/mdmonitor;
fi
if [ ! -d /tmp/RCS ]; then
mkdir -m 700 /tmp/RCS
chown 0:0 /tmp/RCS
fi;
echo "original" | /opt/rocks/bin/ci /tmp/mdmonitor;
/opt/rocks/bin/co -f -l /tmp/mdmonitor;
fi
sed -e 's/--user=root//' /etc/rc.d/init.d/mdmonitor > /tmp/mdmonitor
touch /tmp/mdmonitor

if [ ! -f /etc/rc.d/init.d/RCS/mdmonitor,v ]; then
if [ ! -f /etc/rc.d/init.d/mdmonitor ]; then
touch /etc/rc.d/init.d/mdmonitor;
fi
if [ ! -d /etc/rc.d/init.d/RCS ]; then
mkdir -m 700 /etc/rc.d/init.d/RCS
chown 0:0 /etc/rc.d/init.d/RCS
fi;
echo "original" | /opt/rocks/bin/ci /etc/rc.d/init.d/mdmonitor;
/opt/rocks/bin/co -f -l /etc/rc.d/init.d/mdmonitor;
fi
chmod 755 /etc/rc.d/init.d/mdmonitor
cat /tmp/mdmonitor > /etc/rc.d/init.d/mdmonitor
touch /etc/rc.d/init.d/mdmonitor


rm /tmp/mdmonitor
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/base.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/base.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


if [ ! -f /etc/rc.d/rocksconfig.d/RCS/post-01-cleanup-ks-scripts,v ]; then
if [ ! -f /etc/rc.d/rocksconfig.d/post-01-cleanup-ks-scripts ]; then
touch /etc/rc.d/rocksconfig.d/post-01-cleanup-ks-scripts;
fi
if [ ! -d /etc/rc.d/rocksconfig.d/RCS ]; then
mkdir -m 700 /etc/rc.d/rocksconfig.d/RCS
chown 0:0 /etc/rc.d/rocksconfig.d/RCS
fi;
echo "original" | /opt/rocks/bin/ci /etc/rc.d/rocksconfig.d/post-01-cleanup-ks-scripts;
/opt/rocks/bin/co -f -l /etc/rc.d/rocksconfig.d/post-01-cleanup-ks-scripts;
fi
chmod 0755 /etc/rc.d/rocksconfig.d/post-01-cleanup-ks-scripts
cat > /etc/rc.d/rocksconfig.d/post-01-cleanup-ks-scripts << 'EOF'
#!/bin/bash
rm -f /tmp/ks-script*
rm -f /etc/rc.d/rocksconfig.d/post-01-cleanup-ks-scripts
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/base.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/411-client.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log

/sbin/chkconfig channeld on
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/411-client.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/411-client.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/411-client.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/411-client.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log

mkdir -p /etc/411-security


if [ ! -f /etc/411-security/RCS/master.pub,v ]; then
if [ ! -f /etc/411-security/master.pub ]; then
touch /etc/411-security/master.pub;
fi
if [ ! -d /etc/411-security/RCS ]; then
mkdir -m 700 /etc/411-security/RCS
chown 0:0 /etc/411-security/RCS
fi;
echo "original" | /opt/rocks/bin/ci /etc/411-security/master.pub;
/opt/rocks/bin/co -f -l /etc/411-security/master.pub;
fi
chown root:root /etc/411-security/master.pub
chown root:root /etc/411-security/RCS/master.pub,v
chmod 0444 /etc/411-security/master.pub
cat > /etc/411-security/master.pub << 'EOF'
-----BEGIN PUBLIC KEY-----
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQClOm20pzfTySELzCPyXfMVOY/S
o17tV+MkC0dS4WKZOUKKyBZkUBRwAsFVwMsWZ6m/GICial+crKQTYH9Q8SzXNjel
2o2exaj4KeADvv1u44/BvpW7Z80uXnwkOcP0HLY/iDrGjDqL5bDadZ0T1qfrH3Tg
AwQ2/rHkKdpG+VPlVwIDAQAB
-----END PUBLIC KEY-----

EOF


if [ ! -f /etc/RCS/411.conf,v ]; then
if [ ! -f /etc/411.conf ]; then
touch /etc/411.conf;
fi
if [ ! -d /etc/RCS ]; then
mkdir -m 700 /etc/RCS
chown 0:0 /etc/RCS
fi;
echo "original" | /opt/rocks/bin/ci /etc/411.conf;
/opt/rocks/bin/co -f -l /etc/411.conf;
fi
chown root:root /etc/411.conf
chown root:root /etc/RCS/411.conf,v
chmod 0600 /etc/411.conf
cat > /etc/411.conf << 'EOF'
<!-- 411 Configuration -->
<config>
<master url="http://10.1.1.1:372/411.d/"/>
<appliance>compute</appliance>
<group>Compute</group>
<os>linux</os>
</config>

EOF

if [ ! -f /etc/rc.d/rocksconfig.d/RCS/post-02-411get,v ]; then
if [ ! -f /etc/rc.d/rocksconfig.d/post-02-411get ]; then
touch /etc/rc.d/rocksconfig.d/post-02-411get;
fi
if [ ! -d /etc/rc.d/rocksconfig.d/RCS ]; then
mkdir -m 700 /etc/rc.d/rocksconfig.d/RCS
chown 0:0 /etc/rc.d/rocksconfig.d/RCS
fi;
echo "original" | /opt/rocks/bin/ci /etc/rc.d/rocksconfig.d/post-02-411get;
/opt/rocks/bin/co -f -l /etc/rc.d/rocksconfig.d/post-02-411get;
fi
chmod 0700 /etc/rc.d/rocksconfig.d/post-02-411get
cat > /etc/rc.d/rocksconfig.d/post-02-411get << 'EOF'
#!/bin/bash

# Tell frontend to send you the 411 shared key
/opt/rocks/bin/get-411-key 10.1.1.1

# Wait 10 seconds for shared key to get populated
for i in 1 2 3 4 5 6 7 8 9 10 11 12; do
[ ! -f /etc/411-security/shared.key ] && sleep 10
done

# If shared key got transferred, do a 411get and pull information
# from frontend

[ -f /etc/411-security/shared.key ] && /opt/rocks/bin/411get --all

if [ -f /etc/rc3.d/S*autofs || -f /etc/rc5.d/S*autofs ]; then
/sbin/service autofs restart
fi

rm -rf /etc/rc.d/rocksconfig.d/post-02-411get
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/411-client.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/client.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


if [ ! -f /var/cluster/RCS/frontend,v ]; then
if [ ! -f /var/cluster/frontend ]; then
touch /var/cluster/frontend;
fi
if [ ! -d /var/cluster/RCS ]; then
mkdir -m 700 /var/cluster/RCS
chown 0:0 /var/cluster/RCS
fi;
echo "original" | /opt/rocks/bin/ci /var/cluster/frontend;
/opt/rocks/bin/co -f -l /var/cluster/frontend;
fi
cat > /var/cluster/frontend << 'EOF'
10.1.1.1
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/client.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/client.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log

if [ ! -f /opt/rocks/lib/python2.4/site-packages/rocks/RCS/__init__.py,v ]; then
if [ ! -f /opt/rocks/lib/python2.4/site-packages/rocks/__init__.py ]; then
touch /opt/rocks/lib/python2.4/site-packages/rocks/__init__.py;
fi
if [ ! -d /opt/rocks/lib/python2.4/site-packages/rocks/RCS ]; then
mkdir -m 700 /opt/rocks/lib/python2.4/site-packages/rocks/RCS
chown 0:0 /opt/rocks/lib/python2.4/site-packages/rocks/RCS
fi;
echo "original" | /opt/rocks/bin/ci /opt/rocks/lib/python2.4/site-packages/rocks/__init__.py;
/opt/rocks/bin/co -f -l /opt/rocks/lib/python2.4/site-packages/rocks/__init__.py;
fi
cat >> /opt/rocks/lib/python2.4/site-packages/rocks/__init__.py << 'EOF'
DatabaseHost = "fyr"
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/client.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/client.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log

if [ ! -f /etc/ld.so.conf.d/RCS/foundation-mysql.conf,v ]; then
if [ ! -f /etc/ld.so.conf.d/foundation-mysql.conf ]; then
touch /etc/ld.so.conf.d/foundation-mysql.conf;
fi
if [ ! -d /etc/ld.so.conf.d/RCS ]; then
mkdir -m 700 /etc/ld.so.conf.d/RCS
chown 0:0 /etc/ld.so.conf.d/RCS
fi;
echo "original" | /opt/rocks/bin/ci /etc/ld.so.conf.d/foundation-mysql.conf;
/opt/rocks/bin/co -f -l /etc/ld.so.conf.d/foundation-mysql.conf;
fi
cat > /etc/ld.so.conf.d/foundation-mysql.conf << 'EOF'
/opt/rocks/lib/mysql
EOF


/sbin/ldconfig
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/client.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/disk-stamp.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log

if [ ! -f /etc/RCS/rocks-release,v ]; then
if [ ! -f /etc/rocks-release ]; then
touch /etc/rocks-release;
fi
if [ ! -d /etc/RCS ]; then
mkdir -m 700 /etc/RCS
chown 0:0 /etc/RCS
fi;
echo "original" | /opt/rocks/bin/ci /etc/rocks-release;
/opt/rocks/bin/co -f -l /etc/rocks-release;
fi
cat > /etc/rocks-release << 'EOF'
Rocks release 5.4.3 (Viper)
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/disk-stamp.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/disk-stamp.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log

sed "s/redhat-release/rocks-release/" /etc/rc.sysinit > /tmp/rc.sysinit
cp /tmp/rc.sysinit /etc/rc.sysinit
rm /tmp/rc.sysinit
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/disk-stamp.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/foundation-base.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


/opt/rocks/bin/dot -c
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/foundation-base.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/foundation-base.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log

if [ ! -f /etc/ld.so.conf.d/RCS/foundation.conf,v ]; then
if [ ! -f /etc/ld.so.conf.d/foundation.conf ]; then
touch /etc/ld.so.conf.d/foundation.conf;
fi
if [ ! -d /etc/ld.so.conf.d/RCS ]; then
mkdir -m 700 /etc/ld.so.conf.d/RCS
chown 0:0 /etc/ld.so.conf.d/RCS
fi;
echo "original" | /opt/rocks/bin/ci /etc/ld.so.conf.d/foundation.conf;
/opt/rocks/bin/co -f -l /etc/ld.so.conf.d/foundation.conf;
fi
cat > /etc/ld.so.conf.d/foundation.conf << 'EOF'
/lib
/lib64
/usr/lib
/usr/lib64
/opt/rocks/lib
EOF


/sbin/ldconfig
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/foundation-base.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/foundation-cpan.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log

mkdir -p /export/cpan
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/foundation-cpan.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/ganglia.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log

ln -s /opt/ganglia/sbin/gmond /usr/sbin/gmond
ln -s /opt/rocks/bin/rrdtool /usr/bin/rrdtool
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/ganglia.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/ganglia.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log

/sbin/chkconfig --add gmond


cat >> /etc/man.config << 'EOF'
MANPATH /opt/ganglia/man
EOF


cp /var/www/html/phpsysinfo/config.php.new /var/www/html/phpsysinfo/config.php
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/ganglia.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/ganglia.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/ganglia.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/ganglia.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


if [ ! -f /etc/ld.so.conf.d/RCS/ganglia.conf,v ]; then
if [ ! -f /etc/ld.so.conf.d/ganglia.conf ]; then
touch /etc/ld.so.conf.d/ganglia.conf;
fi
if [ ! -d /etc/ld.so.conf.d/RCS ]; then
mkdir -m 700 /etc/ld.so.conf.d/RCS
chown 0:0 /etc/ld.so.conf.d/RCS
fi;
echo "original" | /opt/rocks/bin/ci /etc/ld.so.conf.d/ganglia.conf;
/opt/rocks/bin/co -f -l /etc/ld.so.conf.d/ganglia.conf;
fi
cat > /etc/ld.so.conf.d/ganglia.conf << 'EOF'
/opt/ganglia/lib64
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/ganglia.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/ganglia.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/ganglia.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/ganglia.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log

/sbin/ldconfig
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/ganglia.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/ganglia.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/ganglia.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/ganglia-client.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log

/sbin/chkconfig --del gmetad
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/ganglia-client.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/ganglia-client.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


mkdir -p /etc/ganglia


if [ ! -f /etc/ganglia/RCS/gmond.conf,v ]; then
if [ ! -f /etc/ganglia/gmond.conf ]; then
touch /etc/ganglia/gmond.conf;
fi
if [ ! -d /etc/ganglia/RCS ]; then
mkdir -m 700 /etc/ganglia/RCS
chown 0:0 /etc/ganglia/RCS
fi;
echo "original" | /opt/rocks/bin/ci /etc/ganglia/gmond.conf;
/opt/rocks/bin/co -f -l /etc/ganglia/gmond.conf;
fi
cat > /etc/ganglia/gmond.conf << 'EOF'
/* Global Configuration */
globals {
daemonize = yes
setuid = yes
user = nobody
debug_level = 0
max_udp_msg_len = 1472
mute = no
deaf = yes
host_dmax = 0 /* secs */
cleanup_threshold = 300 /* secs */
gexec = no
send_metadata_interval = 180 /* secs */
}

/* Cluster Specific attributes */
cluster {
name = "Fyr"
owner = "School of Photovoltaic and Renewable Energy Eng"
latlong = "S33.917422 E151.226571"
url = "http://www.pv.unsw.edu.au"
}

/* Host configuration */host {
location="0,0,0"
}

/* UDP Channels for Send and Recv */udp_recv_channel {
mcast_join = 224.0.0.3
port = 8649
}
udp_send_channel {
mcast_join = 224.0.0.3
host = 10.1.1.1
port = 8649
}

/* TCP Accept Channel */
tcp_accept_channel {
port = 8649

acl {
default = "deny"

access {
ip = 127.0.0.1
mask = 32
action = "allow"
}

access {
ip = 10.1.0.0
mask = 16
action = "allow"
}
}
}

/* Modules */
modules {
module {
name = "core_metrics"
}

module {
name = "cpu_module"
path = "modcpu.so"
}

module {
name = "disk_module"
path = "moddisk.so"
}

module {
name = "load_module"
path = "modload.so"
}

module {
name = "mem_module"
path = "modmem.so"
}

module {
name = "net_module"
path = "modnet.so"
}

module {
name = "proc_module"
path = "modproc.so"
}

module {
name = "sys_module"
path = "modsys.so"
}

module {
name = "python_module"
path = "modpython.so"
params = "/opt/ganglia/lib64/ganglia/python_modules"
}
}

/* Metrics Collection group */
collection_group {
collect_every = 60
time_threshold = 300
metric {
name = "location"
value_threshold = 10.0
}
metric {
name = "load_one"
value_threshold = 10.0
}
metric {
name = "mem_total"
value_threshold = 10.0
}
metric {
name = "cpu_intr"
value_threshold = 10.0
}
metric {
name = "proc_run"
value_threshold = 10.0
}
metric {
name = "load_five"
value_threshold = 10.0
}
metric {
name = "disk_free"
value_threshold = 10.0
}
metric {
name = "mem_cached"
value_threshold = 10.0
}
metric {
name = "mtu"
value_threshold = 10.0
}
metric {
name = "cpu_sintr"
value_threshold = 10.0
}
metric {
name = "pkts_in"
value_threshold = 10.0
}
metric {
name = "bytes_in"
value_threshold = 10.0
}
metric {
name = "bytes_out"
value_threshold = 10.0
}
metric {
name = "swap_total"
value_threshold = 10.0
}
metric {
name = "mem_free"
value_threshold = 10.0
}
metric {
name = "load_fifteen"
value_threshold = 10.0
}
metric {
name = "boottime"
value_threshold = 10.0
}
metric {
name = "cpu_idle"
value_threshold = 10.0
}
metric {
name = "cpu_aidle"
value_threshold = 10.0
}
metric {
name = "cpu_user"
value_threshold = 10.0
}
metric {
name = "cpu_nice"
value_threshold = 10.0
}
metric {
name = "sys_clock"
value_threshold = 10.0
}
metric {
name = "mem_buffers"
value_threshold = 10.0
}
metric {
name = "cpu_system"
value_threshold = 10.0
}
metric {
name = "part_max_used"
value_threshold = 10.0
}
metric {
name = "disk_total"
value_threshold = 10.0
}
metric {
name = "heartbeat"
value_threshold = 10.0
}
metric {
name = "mem_shared"
value_threshold = 10.0
}
metric {
name = "machine_type"
value_threshold = 10.0
}
metric {
name = "cpu_wio"
value_threshold = 10.0
}
metric {
name = "proc_total"
value_threshold = 10.0
}
metric {
name = "cpu_num"
value_threshold = 10.0
}
metric {
name = "cpu_speed"
value_threshold = 10.0
}
metric {
name = "pkts_out"
value_threshold = 10.0
}
metric {
name = "swap_free"
value_threshold = 10.0
}
metric{
name = 'os_name'
}
metric{
name = 'os_release'
}
}

include ('/opt/ganglia/etc/conf.d/*.pyconf')

EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/ganglia-client.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/hpc-client.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cpus=`grep 'processor' /proc/cpuinfo | wc -l`
maxstartups=$(echo "$cpus * 2" | bc)

if [ $maxstartups -lt 10 ]
then
maxstartups=10
fi

export maxstartups
echo "MaxStartups $maxstartups" >> /etc/ssh/sshd_config
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/hpc-client.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/i18n.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log

if [ ! -f /etc/profile.d/RCS/rocks-lang.sh,v ]; then
if [ ! -f /etc/profile.d/rocks-lang.sh ]; then
touch /etc/profile.d/rocks-lang.sh;
fi
if [ ! -d /etc/profile.d/RCS ]; then
mkdir -m 700 /etc/profile.d/RCS
chown 0:0 /etc/profile.d/RCS
fi;
echo "original" | /opt/rocks/bin/ci /etc/profile.d/rocks-lang.sh;
/opt/rocks/bin/co -f -l /etc/profile.d/rocks-lang.sh;
fi
chmod 0755 /etc/profile.d/rocks-lang.sh
cat > /etc/profile.d/rocks-lang.sh << 'EOF'
if [ "$TERM" = "linux" ] ; then
case $LANG in
*.utf8*|*.UTF-8*)
export LANG=en_US
;;
esac
fi
EOF

if [ ! -f /etc/profile.d/RCS/rocks-lang.csh,v ]; then
if [ ! -f /etc/profile.d/rocks-lang.csh ]; then
touch /etc/profile.d/rocks-lang.csh;
fi
if [ ! -d /etc/profile.d/RCS ]; then
mkdir -m 700 /etc/profile.d/RCS
chown 0:0 /etc/profile.d/RCS
fi;
echo "original" | /opt/rocks/bin/ci /etc/profile.d/rocks-lang.csh;
/opt/rocks/bin/co -f -l /etc/profile.d/rocks-lang.csh;
fi
chmod 0755 /etc/profile.d/rocks-lang.csh
cat > /etc/profile.d/rocks-lang.csh << 'EOF'
if ( $?TERM ) then
if ( "$TERM" == "linux" ) then
switch ($LANG)
case *.utf8*:
case *.UTF-8*:
setenv LANG en_US
breaksw
endsw
endif
endif
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/i18n.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/ipmi-base.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


if /usr/sbin/dmidecode | fgrep IPMI
then
/sbin/chkconfig ipmi on
else
/sbin/chkconfig ipmi off
fi

if [ ! -f /etc/sysconfig/network-scripts/RCS/network-functions,v ]; then
if [ ! -f /etc/sysconfig/network-scripts/network-functions ]; then
touch /etc/sysconfig/network-scripts/network-functions;
fi
if [ ! -d /etc/sysconfig/network-scripts/RCS ]; then
mkdir -m 700 /etc/sysconfig/network-scripts/RCS
chown 0:0 /etc/sysconfig/network-scripts/RCS
fi;
echo "original" | /opt/rocks/bin/ci /etc/sysconfig/network-scripts/network-functions;
/opt/rocks/bin/co -f -l /etc/sysconfig/network-scripts/network-functions;
fi
cat >> /etc/sysconfig/network-scripts/network-functions << 'EOF'

# Load IPMI default settings only once, but keep a log of what we did.

if [ -f /etc/sysconfig/ipmi-settings ]; then
. /etc/sysconfig/ipmi-settings
mv /etc/sysconfig/ipmi-settings /etc/sysconfig/ipmi-settings.bak
fi
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/ipmi-base.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/kernel.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


if [ ! -f /etc/rc.d/rocksconfig.d/RCS/pre-09-prep-kernel-source,v ]; then
if [ ! -f /etc/rc.d/rocksconfig.d/pre-09-prep-kernel-source ]; then
touch /etc/rc.d/rocksconfig.d/pre-09-prep-kernel-source;
fi
if [ ! -d /etc/rc.d/rocksconfig.d/RCS ]; then
mkdir -m 700 /etc/rc.d/rocksconfig.d/RCS
chown 0:0 /etc/rc.d/rocksconfig.d/RCS
fi;
echo "original" | /opt/rocks/bin/ci /etc/rc.d/rocksconfig.d/pre-09-prep-kernel-source;
/opt/rocks/bin/co -f -l /etc/rc.d/rocksconfig.d/pre-09-prep-kernel-source;
fi
chmod 755 /etc/rc.d/rocksconfig.d/pre-09-prep-kernel-source
cat > /etc/rc.d/rocksconfig.d/pre-09-prep-kernel-source << 'EOF'
#!/opt/rocks/bin/python
import os

if os.uname()[2].find('smp') < 0:
smp = 0
else:
smp = 1

kver = os.uname()[2].split('smp')[0]
karch = os.uname()[-1]

if smp:
kdir = '-'.join([kver,'smp',karch])
else:
kdir = '-'.join([kver,karch])

os.system('rm -f /usr/src/linux-2.6')
os.system('ln -sf /usr/src/kernels/%s /usr/src/linux-2.6' % kdir)
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/kernel.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/logrotate.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log

if [ ! -f /etc/logrotate.d/RCS/rocks,v ]; then
if [ ! -f /etc/logrotate.d/rocks ]; then
touch /etc/logrotate.d/rocks;
fi
if [ ! -d /etc/logrotate.d/RCS ]; then
mkdir -m 700 /etc/logrotate.d/RCS
chown 0:0 /etc/logrotate.d/RCS
fi;
echo "original" | /opt/rocks/bin/ci /etc/logrotate.d/rocks;
/opt/rocks/bin/co -f -l /etc/logrotate.d/rocks;
fi
cat > /etc/logrotate.d/rocks << 'EOF'
/var/log/auth {
size=100M
postrotate
/bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` \
2> /dev/null || true
endscript
}
/var/log/authpriv {
size=100M
postrotate
/bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` \
2> /dev/null || true
endscript
}
/var/log/daemon {
size=100M
postrotate
/bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` \
2> /dev/null || true
endscript
}
/var/log/lpr {
size=100M
postrotate
/bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` \
2> /dev/null || true
endscript
}
/var/log/mail {
size=100M
postrotate
/bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` \
2> /dev/null || true
endscript
}
/var/log/kern {
size=100M
postrotate
/bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` \
2> /dev/null || true
endscript
}
/var/log/syslog {
size=100M
postrotate
/bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` \
2> /dev/null || true
endscript
}
/var/log/user {
size=100M
postrotate
/bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` \
2> /dev/null || true
endscript
}
/var/log/local[1-9] {
size=10M
postrotate
/bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` \
2> /dev/null || true
endscript
}
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/logrotate.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/logrotate.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/logrotate.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/mail.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


/sbin/chkconfig sendmail off
ln -sf /usr/sbin/sendmail.postfix /etc/alternatives/mta

/sbin/chkconfig postfix on
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/mail.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/mail.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/mail.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/mail.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log

rm -f /etc/postfix/aliases.db
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/mail.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/mail-client.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log

if [ ! -f /etc/postfix/RCS/main.cf,v ]; then
if [ ! -f /etc/postfix/main.cf ]; then
touch /etc/postfix/main.cf;
fi
if [ ! -d /etc/postfix/RCS ]; then
mkdir -m 700 /etc/postfix/RCS
chown 0:0 /etc/postfix/RCS
fi;
echo "original" | /opt/rocks/bin/ci /etc/postfix/main.cf;
/opt/rocks/bin/co -f -l /etc/postfix/main.cf;
fi
cat >> /etc/postfix/main.cf << 'EOF'
#
# Rocks Postfix configuration for cluster nodes.
#
mydestination =
relayhost = 10.1.1.1
masquerade_domains = local
append_dot_mydomain = no
EOF

cat >> /etc/postfix/main.cf << 'EOF'
canonical_maps = hash:/etc/postfix/canonical
EOF

if [ ! -f /etc/postfix/RCS/canonical,v ]; then
if [ ! -f /etc/postfix/canonical ]; then
touch /etc/postfix/canonical;
fi
if [ ! -d /etc/postfix/RCS ]; then
mkdir -m 700 /etc/postfix/RCS
chown 0:0 /etc/postfix/RCS
fi;
echo "original" | /opt/rocks/bin/ci /etc/postfix/canonical;
/opt/rocks/bin/co -f -l /etc/postfix/canonical;
fi
cat >> /etc/postfix/canonical << 'EOF'
root root@local
EOF


/usr/sbin/postmap /etc/postfix/canonical
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/mail-client.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/modules-base.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log

if [ ! -f /etc/profile.d/RCS/modules.csh,v ]; then
if [ ! -f /etc/profile.d/modules.csh ]; then
touch /etc/profile.d/modules.csh;
fi
if [ ! -d /etc/profile.d/RCS ]; then
mkdir -m 700 /etc/profile.d/RCS
chown 0:0 /etc/profile.d/RCS
fi;
echo "original" | /opt/rocks/bin/ci /etc/profile.d/modules.csh;
/opt/rocks/bin/co -f -l /etc/profile.d/modules.csh;
fi
cat > /etc/profile.d/modules.csh << 'EOF'

if ($?tcsh) then
set modules_shell="tcsh"
else
set modules_shell="csh"
endif
if ( $?MODULE_VERSION ) then
setenv MODULE_VERSION_STACK "$MODULE_VERSION"
else
setenv MODULE_VERSION "3.2.8"
setenv MODULE_VERSION_STACK "3.2.8"
endif
set exec_prefix='/opt/modules'
#set exec_prefix='/opt/modules/bin'

set prefix=""
set postfix=""

if ( $?histchars ) then
set histchar = `echo $histchars | cut -c1`
set _histchars = $histchars

set prefix = 'unset histchars;'
set postfix = 'set histchars = $_histchars;'
else
set histchar = \!
endif

if ($?prompt) then
set prefix = "$prefix"'set _prompt="$prompt";set prompt="";'
set postfix = "$postfix"'set prompt="$_prompt";unset _prompt;'
endif

if ($?noglob) then
set prefix = "$prefix""set noglob;"
set postfix = "$postfix""unset noglob;"
endif
set postfix = "set _exit="'$status'"; $postfix; test 0 = "'$_exit;'

alias module $prefix'eval `'$exec_prefix'/bin/modulecmd '$modules_shell' '$histchar'*`; '$postfix
#alias module $prefix'eval `'$exec_prefix'/modulecmd '$modules_shell' '$histchar'*`; '$postfix
unset exec_prefix
unset prefix
unset postfix

setenv MODULESHOME /opt/modules

if (! $?MODULEPATH ) then
setenv MODULEPATH `sed 's/#.*$//' ${MODULESHOME}/init/.modulespath | awk 'NF==1{printf("%s:",$1)}'`
endif

if (! $?LOADEDMODULES ) then
setenv LOADEDMODULES ""
endif

EOF

if [ ! -f /etc/profile.d/RCS/modules.sh,v ]; then
if [ ! -f /etc/profile.d/modules.sh ]; then
touch /etc/profile.d/modules.sh;
fi
if [ ! -d /etc/profile.d/RCS ]; then
mkdir -m 700 /etc/profile.d/RCS
chown 0:0 /etc/profile.d/RCS
fi;
echo "original" | /opt/rocks/bin/ci /etc/profile.d/modules.sh;
/opt/rocks/bin/co -f -l /etc/profile.d/modules.sh;
fi
cat > /etc/profile.d/modules.sh << 'EOF'

if [ "${MODULE_VERSION:-}" = "" ]; then
MODULE_VERSION_STACK="3.2.8"
MODULE_VERSION="3.2.8"
export MODULE_VERSION
else
MODULE_VERSION_STACK="$MODULE_VERSION"
fi
export MODULE_VERSION_STACK

module() { eval `/opt/modules/bin/modulecmd bash $*`; }
#module() { eval `/opt/modules/bin/modulecmd bash $*`; }

MODULESHOME=/opt/modules
export MODULESHOME

if [ "${LOADEDMODULES:-}" = "" ]; then
LOADEDMODULES=
export LOADEDMODULES
fi

if [ "${MODULEPATH:-}" = "" ]; then
MODULEPATH=`sed 's/#.*$//' ${MODULESHOME}/init/.modulespath | awk 'NF==1{printf("%s:",$1)}'`
export MODULEPATH
fi

EOF

if [ ! -f /opt/modules/init/RCS/.modulespath,v ]; then
if [ ! -f /opt/modules/init/.modulespath ]; then
touch /opt/modules/init/.modulespath;
fi
if [ ! -d /opt/modules/init/RCS ]; then
mkdir -m 700 /opt/modules/init/RCS
chown 0:0 /opt/modules/init/RCS
fi;
echo "original" | /opt/rocks/bin/ci /opt/modules/init/.modulespath;
/opt/rocks/bin/co -f -l /opt/modules/init/.modulespath;
fi
cat >> /opt/modules/init/.modulespath << 'EOF'
/share/apps/modules/modulefiles # Automount location of shared modulefiles
EOF

if [ ! -e /opt/modules/extras ] ; then
mkdir -p /opt/modules/extras
fi


ln -s /opt/modules /opt/modules/Modules/3.2.8
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/modules-base.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/mpi.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log

cat >> /etc/man.config << 'EOF'
MANPATH /opt/openmpi/share/man
MANPATH /opt/sun-ct/man
MANPATH /opt/mpich2/gnu/man
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/mpi.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/mpi.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log

ln -s /opt/SUNWhpc/HPC8.2.1/gnu /opt/sun-ct
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/mpi.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/mpi.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/mpi.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/mpi.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/mpi.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/mpi.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cp -f /opt/openmpi/share/mpi-selector/rocks-openmpi* \
/var/lib/mpi-selector/data


cp -f /opt/sun-ct/share/mpi-selector/sun-ct* \
/var/lib/mpi-selector/data


if [ ! -f /etc/rc.d/rocksconfig.d/RCS/post-92-mpiselector,v ]; then
if [ ! -f /etc/rc.d/rocksconfig.d/post-92-mpiselector ]; then
touch /etc/rc.d/rocksconfig.d/post-92-mpiselector;
fi
if [ ! -d /etc/rc.d/rocksconfig.d/RCS ]; then
mkdir -m 700 /etc/rc.d/rocksconfig.d/RCS
chown 0:0 /etc/rc.d/rocksconfig.d/RCS
fi;
echo "original" | /opt/rocks/bin/ci /etc/rc.d/rocksconfig.d/post-92-mpiselector;
/opt/rocks/bin/co -f -l /etc/rc.d/rocksconfig.d/post-92-mpiselector;
fi
chmod 0755 /etc/rc.d/rocksconfig.d/post-92-mpiselector
cat > /etc/rc.d/rocksconfig.d/post-92-mpiselector << 'EOF'
#!/bin/bash

ROCKSMPI=`/usr/bin/mpi-selector --list | grep rocks-openmpi`
/usr/bin/mpi-selector --system --set $ROCKSMPI

EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/mpi.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/node-certs.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


for i in "/root/.ssh" ; do
if [ ! -d $i ]; then
/bin/mkdir -p $i
fi
done


if [ ! -f /root/.ssh/RCS/authorized_keys,v ]; then
if [ ! -f /root/.ssh/authorized_keys ]; then
touch /root/.ssh/authorized_keys;
fi
if [ ! -d /root/.ssh/RCS ]; then
mkdir -m 700 /root/.ssh/RCS
chown 0:0 /root/.ssh/RCS
fi;
echo "original" | /opt/rocks/bin/ci /root/.ssh/authorized_keys;
/opt/rocks/bin/co -f -l /root/.ssh/authorized_keys;
fi
chmod 0600 /root/.ssh/authorized_keys
cat > /root/.ssh/authorized_keys << 'EOF'
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAt/mlYPuqfoNYKcDBT3+NnIlv+lV2dkVz1+9zxa3J0FbfI2VFvI1+OZzVk72wgIGH7nNU1RiO2rJ6cxNi2zYLBFcgwwwuqzN0T2OW2Edq4LpJGJVVn9Q3tRIxXDKCZAey4x2RZHxO508EVT5QdFHoylUQqLaE8utsHG22XlHtHhs/zdfag3vc7J7eAMDJsSuvUbplEXFs2le6g/GKVmAmInjo8g2EzHLOEL4c1nBAzdaS0iVxZ8wKsxrKnUKLi+o5HqC4LyZuxxvxDIPhmxxvoEKwb1XxQFO0+307/490G04KJnqvB/1ka3s/m5LWKjOdfmuxbgwmkFB53wlve0UtPQ== ro...@fyr.pvcentre.pv.unsw.edu.au

EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/node-certs.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/node-certs.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/node-certs.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/ntp.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


/sbin/chkconfig ntpd on


if [ ! -f /etc/cron.hourly/RCS/ntp,v ]; then
if [ ! -f /etc/cron.hourly/ntp ]; then
touch /etc/cron.hourly/ntp;
fi
if [ ! -d /etc/cron.hourly/RCS ]; then
mkdir -m 700 /etc/cron.hourly/RCS
chown 0:0 /etc/cron.hourly/RCS
fi;
echo "original" | /opt/rocks/bin/ci /etc/cron.hourly/ntp;
/opt/rocks/bin/co -f -l /etc/cron.hourly/ntp;
fi
chmod 0755 /etc/cron.hourly/ntp
cat > /etc/cron.hourly/ntp << 'EOF'
#!/bin/sh
if ! ( /usr/sbin/ntpq -pn 2> /dev/null | grep -e '^\*' > /dev/null ); then
/etc/rc.d/init.d/ntpd restart > /dev/null 2>&1
fi
EOF

if [ ! -f /etc/sysconfig/RCS/ntpd,v ]; then
if [ ! -f /etc/sysconfig/ntpd ]; then
touch /etc/sysconfig/ntpd;
fi
if [ ! -d /etc/sysconfig/RCS ]; then
mkdir -m 700 /etc/sysconfig/RCS
chown 0:0 /etc/sysconfig/RCS
fi;
echo "original" | /opt/rocks/bin/ci /etc/sysconfig/ntpd;
/opt/rocks/bin/co -f -l /etc/sysconfig/ntpd;
fi
cat > /etc/sysconfig/ntpd << 'EOF'
OPTIONS="-A -u ntp:ntp -p /var/run/ntpd.pid"
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/ntp.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/ntp.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/ntp.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/ntp-client.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log

if [ ! -f /etc/RCS/ntp.conf,v ]; then
if [ ! -f /etc/ntp.conf ]; then
touch /etc/ntp.conf;
fi
if [ ! -d /etc/RCS ]; then
mkdir -m 700 /etc/RCS
chown 0:0 /etc/RCS
fi;
echo "original" | /opt/rocks/bin/ci /etc/ntp.conf;
/opt/rocks/bin/co -f -l /etc/ntp.conf;
fi
cat > /etc/ntp.conf << 'EOF'
server 10.1.1.1
driftfile /var/lib/ntp/drift
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/ntp-client.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/ntp-client.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/ntp-client.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/ntp-client.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log

/bin/mkdir -p /etc/ntp


if [ ! -f /etc/ntp/RCS/step-tickers,v ]; then
if [ ! -f /etc/ntp/step-tickers ]; then
touch /etc/ntp/step-tickers;
fi
if [ ! -d /etc/ntp/RCS ]; then
mkdir -m 700 /etc/ntp/RCS
chown 0:0 /etc/ntp/RCS
fi;
echo "original" | /opt/rocks/bin/ci /etc/ntp/step-tickers;
/opt/rocks/bin/co -f -l /etc/ntp/step-tickers;
fi
cat > /etc/ntp/step-tickers << 'EOF'
10.1.1.1
EOF


/usr/sbin/ntpdate 10.1.1.1
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/ntp-client.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/ntp-client.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log

/sbin/hwclock --systohc --utc
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/ntp-client.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/resolv.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log

if [ ! -f /etc/RCS/resolv.conf,v ]; then
if [ ! -f /etc/resolv.conf ]; then
touch /etc/resolv.conf;
fi
if [ ! -d /etc/RCS ]; then
mkdir -m 700 /etc/RCS
chown 0:0 /etc/RCS
fi;
echo "original" | /opt/rocks/bin/ci /etc/resolv.conf;
/opt/rocks/bin/co -f -l /etc/resolv.conf;
fi
cat > /etc/resolv.conf << 'EOF'
search local pvcentre.pv.unsw.edu.au ipmi
nameserver 10.1.1.1

EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/resolv.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/resolv.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


if [ ! -f /etc/RCS/hosts,v ]; then
if [ ! -f /etc/hosts ]; then
touch /etc/hosts;
fi
if [ ! -d /etc/RCS ]; then
mkdir -m 700 /etc/RCS
chown 0:0 /etc/RCS
fi;
echo "original" | /opt/rocks/bin/ci /etc/hosts;
/opt/rocks/bin/co -f -l /etc/hosts;
fi
cat > /etc/hosts << 'EOF'
127.0.0.1 localhost.localdomain localhost
129.94.216.251 fyr.pvcentre.pv.unsw.edu.au
10.1.255.254 compute-0-0.local compute-0-0
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/resolv.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/resolv.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/resolv.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/security.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log --nochroot

if [ -f /tmp/security/cluster-cert.key ]
then
mv /tmp/security/cluster-cert.key /mnt/sysimage/etc/security/
chmod 0400 /mnt/sysimage/etc/security/cluster-cert.key

mv /tmp/security/cluster-cert.crt /mnt/sysimage/etc/security/
chmod 0444 /mnt/sysimage/etc/security/cluster-cert.crt

mv /tmp/security/cluster-ca.crt /mnt/sysimage/etc/security/
chmod 0444 /mnt/sysimage/etc/security/cluster-ca.crt
fi
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/security.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/security.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/security.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/selinux.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log

if [ ! -f /etc/sysconfig/RCS/selinux,v ]; then
if [ ! -f /etc/sysconfig/selinux ]; then
touch /etc/sysconfig/selinux;
fi
if [ ! -d /etc/sysconfig/RCS ]; then
mkdir -m 700 /etc/sysconfig/RCS
chown 0:0 /etc/sysconfig/RCS
fi;
echo "original" | /opt/rocks/bin/ci /etc/sysconfig/selinux;
/opt/rocks/bin/co -f -l /etc/sysconfig/selinux;
fi
cat > /etc/sysconfig/selinux << 'EOF'
SELINUX=disabled
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/selinux.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/shared-memory.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log

SHMSIZE=`gawk '/MemTotal:/ { printf("(%s/4) * (3 * 1024)\n", $2); }' \
/proc/meminfo | bc`

if [ $SHMSIZE ]
then
echo "kernel.shmmax = " $SHMSIZE >> /etc/sysctl.conf
fi
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/shared-memory.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/shared-memory.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/shared-memory.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/shared-memory.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/shared-memory.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/snmp-server.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log

/sbin/chkconfig snmpd on


if [ ! -f /etc/snmp/RCS/snmpd.conf,v ]; then
if [ ! -f /etc/snmp/snmpd.conf ]; then
touch /etc/snmp/snmpd.conf;
fi
if [ ! -d /etc/snmp/RCS ]; then
mkdir -m 700 /etc/snmp/RCS
chown 0:0 /etc/snmp/RCS
fi;
echo "original" | /opt/rocks/bin/ci /etc/snmp/snmpd.conf;
/opt/rocks/bin/co -f -l /etc/snmp/snmpd.conf;
fi
cat > /etc/snmp/snmpd.conf << 'EOF'
com2sec notConfigUser default public
group notConfigGroup v1 notConfigUser
group notConfigGroup v2c notConfigUser
view all included .1 80

access notConfigGroup "" any noauth exact all all all

syslocation "Tyree Energy Building, UNSW, Sydney, AU"
syscontact "evatt....@unsw.edu.au"
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/snmp-server.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/snmp-server.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/snmp-server.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/ssh.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


if [ ! -f /etc/ssh/RCS/ssh_config,v ]; then
if [ ! -f /etc/ssh/ssh_config ]; then
touch /etc/ssh/ssh_config;
fi
if [ ! -d /etc/ssh/RCS ]; then
mkdir -m 700 /etc/ssh/RCS
chown 0:0 /etc/ssh/RCS
fi;
echo "original" | /opt/rocks/bin/ci /etc/ssh/ssh_config;
/opt/rocks/bin/co -f -l /etc/ssh/ssh_config;
fi
cat > /etc/ssh/ssh_config << 'EOF'
Host *
CheckHostIP no
ForwardX11 yes
ForwardAgent yes
StrictHostKeyChecking no
UsePrivilegedPort no
Protocol 2,1
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/ssh.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/ssh.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log

chmod a+rx /root
mkdir /root/.ssh
chmod a+rx /root/.ssh


sed -e 's/#ChallengeResponseAuthentication yes/ChallengeResponseAuthentication no/' \
/etc/ssh/sshd_config > /tmp/sshd_config
sed -e 's/#PermitUserEnvironment no/PermitUserEnvironment yes/' \
/tmp/sshd_config > /etc/ssh/sshd_config
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/ssh.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/ssh.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/ssh.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/ssh-client.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


key="
U1NIIFBSSVZBVEUgS0VZIEZJTEUgRk9STUFUIDEuMQoAAAAAAAAAAAgACADQXNpqW1USfqeL4AEd
evZ4lvxmNC5Eo1TYFZkgpP3MP8aHXMPgmsjOuIFqWWHhfllt0s7Bxggqe/0AUrGfx2SIbogO5cEM
9uw+Sm2XA4Hc51NkMxie6dIHMcBJsACmHjdQ4OR7C4S6kHjZZgtp0pQRpgh0Jne9OQ3aCVrSyWfI
ZtOcy41Z2Z8SLq3fknoBjT/ANDOtyasAcThfH27rRP2RUdnjfN+ztVqFhlgGIE5NxTmtChFFFomS
rmgEmodNbhy5YecuVmFfHGIdAv7w9EcRP1iE4ORLZ2ax6eXbJzllpfY8u3taEpoObXlIRe/hWP2i
ztIb+QrIikG0xyUrxJwrAAYjAAAAAFIQUhAIAJrIokBhGqAGUJPK+YOdLB8RE0SbypljY5k0naM4
vIkZbug2SF20z6+BvzkPMsTEQm7XHT99KqM3iL5pUL/V8ukBpuZ+yexfqC5F6wJ3okxUEg/rcWAb
aNIk9T4Nt1bUnh7S8t8P3vD9m5oujCK5r9KYmJDMHm9O9FjTv8/I0MDAEoh505AiNVtqV/vUPkjP
8Dlj7LzH4tOEys7f0LANYl5ELJ0++q5cy5SBEHLo9f9S+AeiT5vcHSPs5y94ZOFOSVslMNEbHoaI
SgG95lv41oTFzcqCI/ZMaxN76hgi0F8fzJOsaU6HZ1npUv6Uwtoirl0hR4/BWmskUs9QczfHtTsE
ANn623X61tiJo6yIuKh4Pvw1itubF09aW+4vHlorAIMwoo6xtjr0JUKO/FvGSZS0Eyvu8lgLJyxF
4QTgcwbG1eULXZ31qEiWzYAzWypWdJRdwhe53R4GWAhv7xgGJJSvtwPb/bTYyv8lq4pcc6a0EkOL
FEOTEDEI7uzr4ATj+Xy4BADdDc399RZgoA45qx/JLPFpE0lWQOPzxkt6QAbb/rjEeNBmrkk0/e+D
zy0vKJTgXUbFiot2XxfjMpsjjUfdvMlmlqk+D/jK7ALANIvmZlhmfDHnimGTM42MgpNHEY0IOVrv
VMmIxeJ2i2hx1wXOSGymN5LGeNgm6ailj6LQyPnTJwQA8U1tQV3QRWNgEXUjv3KXnSSVlOTsVKdB
wM2I0p0XvoXqmZyZ9ssN2Fq/HJGgmPFnYVNLfoB9ujmPb7drq5xsjnbLhPEvPCB129JtnYT0Sac+
Pmnj0enVcW25qJVrU7/u/Vw7FgzwBLFeoZCy8+lu4tosyNfD/dh/e3CGzPoqQV0AAAAA
"

echo $key | python -c '
import base64
import sys
base64.decode(sys.stdin, sys.stdout)' > /etc/ssh/ssh_host_key

chmod 0400 /etc/ssh/ssh_host_key

if [ ! -f /etc/ssh/RCS/ssh_host_key.pub,v ]; then
if [ ! -f /etc/ssh/ssh_host_key.pub ]; then
touch /etc/ssh/ssh_host_key.pub;
fi
if [ ! -d /etc/ssh/RCS ]; then
mkdir -m 700 /etc/ssh/RCS
chown 0:0 /etc/ssh/RCS
fi;
echo "original" | /opt/rocks/bin/ci /etc/ssh/ssh_host_key.pub;
/opt/rocks/bin/co -f -l /etc/ssh/ssh_host_key.pub;
fi
chmod 0444 /etc/ssh/ssh_host_key.pub
cat > /etc/ssh/ssh_host_key.pub << 'EOF'
2048 35 26303355045176516275114998723959446306867318852230946252894047901831477591407619736350223209316153866243748572099480488129155487644881460415239558550048058953825909859264716947268803811803057127669775040983209661208304134398979105016887563362742666693730235343810283328490192699840813648507908838768177685785095536010295095520237987493130313604178537089525079847581895436945717880935439217028671463124645414052192319593208143082270352784730451705238858458183119691159966494269839527400952560251107451485375594300482899534696095594250550728968982099255908367833656413022963938255896149522149873149937662640084366957611

EOF

if [ ! -f /etc/ssh/RCS/ssh_host_rsa_key,v ]; then
if [ ! -f /etc/ssh/ssh_host_rsa_key ]; then
touch /etc/ssh/ssh_host_rsa_key;
fi
if [ ! -d /etc/ssh/RCS ]; then
mkdir -m 700 /etc/ssh/RCS
chown 0:0 /etc/ssh/RCS
fi;
echo "original" | /opt/rocks/bin/ci /etc/ssh/ssh_host_rsa_key;
/opt/rocks/bin/co -f -l /etc/ssh/ssh_host_rsa_key;
fi
chmod 0400 /etc/ssh/ssh_host_rsa_key
cat > /etc/ssh/ssh_host_rsa_key << 'EOF'
-----BEGIN RSA PRIVATE KEY-----
MIIEogIBAAKCAQEAyFy4SaJHikvdO/pvtyB6RffDFLfvRVZvag9tqdyLQUnD4EQ2
NdTHescAErfztEpUDiS7UAD6NwU/Nz3khj9ajoJL3fUiIHtG5qRnj6rKjEsso7VW
uTj+WlsiRi9fU8ijHfnpLtHN0G7uDN4+tVHCx6p9kxKZ1gAQjhsKs7Wp0OWqDk8W
JLr8FKOI9rUWCMvLpqX2LQXP495jHMtDyuGGzl2KHnooEPYTXGUHHiQsQ1Mj1jro
0Km2v7OpQ8iKLBswDgFSyekmsWN4i4+5WK7KABwgHy0jXkmYLpV46rAoWUvQDPws
qzORVZg0KwW+kBh1KofibIBf+WQTaLZtrQPAhwIBIwKCAQAzhY55VZ1eE4IIG9OV
fWFFMRToEgpTqIMMpOGvVffsN4ojucTMA4PAfFB514fPRlAg5N+1fJgcxtW9v3VH
F5rxcfZAY5sPqqvU6HJmxYSKebsFhmbB6hWE8tzteeVQDwVfesbuyDw86VMn4WCV
BmVJSRj57tcZxYCZkezPIBW5XywIeNiwa2HnXCOpl2KsFztvDqzDsNCvlT+Sjfsf
h/+xP/mBmRmjo2cAJAD7qK9a15FHifdR42EB2QnDctKa8jrYGRxygdyGYeXTqWx0
HxcwETmnTdXC6u/+NSW+aW/xAcOZhYZOHaHFRzPGmJVnpy/bdQVMHleJKOTBRmLy
jMYrAoGBAPHJqIU0iwEzvXAL/CI9dgb92uDP5soX1Y3FYf9Q1moMjFJuJI9LN6Mo
IeSTBWhjEgXDWbP2bwnLc4eSLA+1Hb+gu+gnGK3dZfOXKyMGFsgGUJVqNLnPdn59
9IsLJVEci6N7CzyxuxuMFU2qbdKZqw/Qh8cQYoQgR8qXB1Gfn6FRAoGBANQjtCnQ
VX4kRuOQFuXYwogxyudHqEwExGxWXZBUwVbXn4nUyVGCQvwXRVecAIu33lrgOnMN
jYkJglEO3fIca+DsADTlgh87K3j2Jw0AycQ+3eNjO3+Yz61F0j6lt+sFR4k86azJ
r+Q8GKtf1MNjVQCSxz+l4MBR7wga8rezeY5XAoGBALqFn0Iv2PJMfDHdXBpp7VXZ
xhskCc8Zs1681pHCBH2x6JdcSBbE/wjV0QDJMA6y02OIEf/bXPjtZ8Ba0Yh1xn3i
ZRIsyeU1w61IuuCBCkKIh06xBBpPleyNDRrOFXkWBVI6WSAxVdNsEG8dEuRKqIiK
7GZdGMxTapT4KjenBh1bAoGBAItn62vvTh+xcGmn1Ihp3uvI8w0DNBSyrPa8aV7Y
nE8CuUvyOybvM1Uz3RxQkqT1K7gPsWGMkDV7RwIRFYHYKaJvM1X158thZbXjlgE7
CD8h/4bMLmnK0Z3AKxM5s1/thsfmMyhnR7M9b0wLxlSDGpn6Def/So0CpGRpeu2/
FV2JAoGAAzWJOw84tU5DEDG7A9QgHKtU2ZYof28ga7ylzA8ANu9KNTDPIwZn0ryN
qQNUeYKs5KEWt+kRU965nFg1WBHoCAYmTI7PFRrZW9QBogGsWxN77wWgjJFkaBg5
+j3+RxQg5BNOmVQ51+hm0urQXFlGk7hmgi+uOSH9lpfi2pbBgIY=
-----END RSA PRIVATE KEY-----

EOF

if [ ! -f /etc/ssh/RCS/ssh_host_rsa_key.pub,v ]; then
if [ ! -f /etc/ssh/ssh_host_rsa_key.pub ]; then
touch /etc/ssh/ssh_host_rsa_key.pub;
fi
if [ ! -d /etc/ssh/RCS ]; then
mkdir -m 700 /etc/ssh/RCS
chown 0:0 /etc/ssh/RCS
fi;
echo "original" | /opt/rocks/bin/ci /etc/ssh/ssh_host_rsa_key.pub;
/opt/rocks/bin/co -f -l /etc/ssh/ssh_host_rsa_key.pub;
fi
chmod 0444 /etc/ssh/ssh_host_rsa_key.pub
cat > /etc/ssh/ssh_host_rsa_key.pub << 'EOF'
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAyFy4SaJHikvdO/pvtyB6RffDFLfvRVZvag9tqdyLQUnD4EQ2NdTHescAErfztEpUDiS7UAD6NwU/Nz3khj9ajoJL3fUiIHtG5qRnj6rKjEsso7VWuTj+WlsiRi9fU8ijHfnpLtHN0G7uDN4+tVHCx6p9kxKZ1gAQjhsKs7Wp0OWqDk8WJLr8FKOI9rUWCMvLpqX2LQXP495jHMtDyuGGzl2KHnooEPYTXGUHHiQsQ1Mj1jro0Km2v7OpQ8iKLBswDgFSyekmsWN4i4+5WK7KABwgHy0jXkmYLpV46rAoWUvQDPwsqzORVZg0KwW+kBh1KofibIBf+WQTaLZtrQPAhw==

EOF

if [ ! -f /etc/ssh/RCS/ssh_host_dsa_key,v ]; then
if [ ! -f /etc/ssh/ssh_host_dsa_key ]; then
touch /etc/ssh/ssh_host_dsa_key;
fi
if [ ! -d /etc/ssh/RCS ]; then
mkdir -m 700 /etc/ssh/RCS
chown 0:0 /etc/ssh/RCS
fi;
echo "original" | /opt/rocks/bin/ci /etc/ssh/ssh_host_dsa_key;
/opt/rocks/bin/co -f -l /etc/ssh/ssh_host_dsa_key;
fi
chmod 0400 /etc/ssh/ssh_host_dsa_key
cat > /etc/ssh/ssh_host_dsa_key << 'EOF'
-----BEGIN DSA PRIVATE KEY-----
MIIBvAIBAAKBgQDV8pR8tu2sdpRfGHNyGVBLelyQ5ygpQv7kIK9t6CyqoG64pK+J
0YV3wRs1frevR2RX6V0HMW1V7JyeUdExpRZfu7uQRKwUwos4NyIUXXnkWGfFlhQo
N0TlLsWtUsrvWatXWcTBJOEG3OLELG8XM28h7Qz47JySshDZukuZYCD4sQIVAOVY
3ycBZPbHqU07x/q9lAkFKJe1AoGADSx1w6wf3HEiFg1ObxUaa/s6lzJrscO1Cj9Z
m0XHOGfrUqj0B9u32+7LDTKDX3MY2sfsmedIBD9lGnp4lZ9TgEtXWmEr8GDeKfYh
9XD0l1ymtHryEsJcsw4VE8Q/l8x7BzHU4Go/MbLdWoGhjucyGMn8bFK4NCJtImqN
BojEWD4CgYEAh/yT+bs6E2yMsuQQZwkq8XqlykSKXZQkqDywFMD3/1p6UP7XqPIy
kIQTspKXZwdgK0gVJjRW5N4T5V7/EgNEu62mYF3akAgGkRcohudgx/Cc8yhr9KZt
p5+rvhjiG9zosydcjVdzuLYwKBf8YGaVJYjCKtK/R7jjzIAzQ8PGe6ECFQCQV/k+
8N3XHoqNDPoOZotldREdrw==
-----END DSA PRIVATE KEY-----

EOF

if [ ! -f /etc/ssh/RCS/ssh_host_dsa_key.pub,v ]; then
if [ ! -f /etc/ssh/ssh_host_dsa_key.pub ]; then
touch /etc/ssh/ssh_host_dsa_key.pub;
fi
if [ ! -d /etc/ssh/RCS ]; then
mkdir -m 700 /etc/ssh/RCS
chown 0:0 /etc/ssh/RCS
fi;
echo "original" | /opt/rocks/bin/ci /etc/ssh/ssh_host_dsa_key.pub;
/opt/rocks/bin/co -f -l /etc/ssh/ssh_host_dsa_key.pub;
fi
chmod 0444 /etc/ssh/ssh_host_dsa_key.pub
cat > /etc/ssh/ssh_host_dsa_key.pub << 'EOF'
ssh-dss AAAAB3NzaC1kc3MAAACBANXylHy27ax2lF8Yc3IZUEt6XJDnKClC/uQgr23oLKqgbrikr4nRhXfBGzV+t69HZFfpXQcxbVXsnJ5R0TGlFl+7u5BErBTCizg3IhRdeeRYZ8WWFCg3ROUuxa1Syu9Zq1dZxMEk4Qbc4sQsbxczbyHtDPjsnJKyENm6S5lgIPixAAAAFQDlWN8nAWT2x6lNO8f6vZQJBSiXtQAAAIANLHXDrB/ccSIWDU5vFRpr+zqXMmuxw7UKP1mbRcc4Z+tSqPQH27fb7ssNMoNfcxjax+yZ50gEP2UaeniVn1OAS1daYSvwYN4p9iH1cPSXXKa0evISwlyzDhUTxD+XzHsHMdTgaj8xst1agaGO5zIYyfxsUrg0Im0iao0GiMRYPgAAAIEAh/yT+bs6E2yMsuQQZwkq8XqlykSKXZQkqDywFMD3/1p6UP7XqPIykIQTspKXZwdgK0gVJjRW5N4T5V7/EgNEu62mYF3akAgGkRcohudgx/Cc8yhr9KZtp5+rvhjiG9zosydcjVdzuLYwKBf8YGaVJYjCKtK/R7jjzIAzQ8PGe6E=

EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/ssh-client.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/ssh-client.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/ssh-client.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/postshell.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


grep -q "postshell" /proc/cmdline
if [ $? -eq 0 ]; then
touch /tmp/postshell
while [ -e /tmp/postshell ]; do /bin/sleep 5; done
fi
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/postshell.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/ethers-server-postshell.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log

%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/ethers-server-postshell.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/pxeboot.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log

if [ ! -f /boot/kickstart/RCS/cluster-kickstart-pxe,v ]; then
if [ ! -f /boot/kickstart/cluster-kickstart-pxe ]; then
touch /boot/kickstart/cluster-kickstart-pxe;
fi
if [ ! -d /boot/kickstart/RCS ]; then
mkdir -m 700 /boot/kickstart/RCS
chown 0:0 /boot/kickstart/RCS
fi;
echo "original" | /opt/rocks/bin/ci /boot/kickstart/cluster-kickstart-pxe;
/opt/rocks/bin/co -f -l /boot/kickstart/cluster-kickstart-pxe;
fi
chown root.wheel /boot/kickstart/cluster-kickstart-pxe
chown root.wheel /boot/kickstart/RCS/cluster-kickstart-pxe,v
chmod u+rwxs,g+rx,o-rwx /boot/kickstart/cluster-kickstart-pxe
cat > /boot/kickstart/cluster-kickstart-pxe << 'EOF'
#!/bin/bash

touch /boot/grub/pxe-install

/etc/rc.d/init.d/rocks-grub start

/usr/bin/wget --quiet --no-check-certificate -O /dev/null \
https://10.1.1.1/install/sbin/public/setPxeboot.cgi?action="install"

/boot/kickstart/cluster-kickstart
EOF

/usr/bin/wget --no-check-certificate -O /dev/null \
https://10.1.1.1/install/sbin/public/setPxeboot.cgi
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/pxeboot.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/pxeboot.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/pxeboot.xml: end post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/extend-compute.xml: begin post section
EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log



cat >> /etc/profile.d/modules.sh << 'EOF'

export -f module

EOF
%post --log=/mnt/sysimage/var/log/rocks-install.log


cat >> /var/log/rocks-install.log << 'EOF'
./nodes/extend-compute.xml: end post section
EOF

%post --log=/mnt/sysimage/var/log/rocks-install.log

cat >> /etc/sysconfig/rocks-pre << EOF

if [ -f /etc/ganglia/gmond.conf ]; then
echo "rocks" | /opt/rocks/bin/ci /etc/ganglia/gmond.conf;
/opt/rocks/bin/co -f -l /etc/ganglia/gmond.conf;
fi

if [ -f /etc/ld.so.conf.d/foundation.conf ]; then
echo "rocks" | /opt/rocks/bin/ci /etc/ld.so.conf.d/foundation.conf;
/opt/rocks/bin/co -f -l /etc/ld.so.conf.d/foundation.conf;
fi

if [ -f /etc/sysconfig/ntpd ]; then
echo "rocks" | /opt/rocks/bin/ci /etc/sysconfig/ntpd;
/opt/rocks/bin/co -f -l /etc/sysconfig/ntpd;
fi

if [ -f /etc/rc.d/rocksconfig.d/post-01-cleanup-ks-scripts ]; then
echo "rocks" | /opt/rocks/bin/ci /etc/rc.d/rocksconfig.d/post-01-cleanup-ks-scripts;
/opt/rocks/bin/co -f -l /etc/rc.d/rocksconfig.d/post-01-cleanup-ks-scripts;
fi
chmod 0755 /etc/rc.d/rocksconfig.d/post-01-cleanup-ks-scripts

if [ -f /etc/inittab ]; then
echo "rocks" | /opt/rocks/bin/ci /etc/inittab;
/opt/rocks/bin/co -f -l /etc/inittab;
fi

if [ -f /etc/ssh/ssh_host_dsa_key ]; then
echo "rocks" | /opt/rocks/bin/ci /etc/ssh/ssh_host_dsa_key;
/opt/rocks/bin/co -f -l /etc/ssh/ssh_host_dsa_key;
fi
chmod 0400 /etc/ssh/ssh_host_dsa_key

if [ -f /etc/rc.d/rocksconfig.d/post-02-411get ]; then
echo "rocks" | /opt/rocks/bin/ci /etc/rc.d/rocksconfig.d/post-02-411get;
/opt/rocks/bin/co -f -l /etc/rc.d/rocksconfig.d/post-02-411get;
fi
chmod 0700 /etc/rc.d/rocksconfig.d/post-02-411get

if [ -f /etc/security/limits.conf ]; then
echo "rocks" | /opt/rocks/bin/ci /etc/security/limits.conf;
/opt/rocks/bin/co -f -l /etc/security/limits.conf;
fi

if [ -f /var/log/boot.log ]; then
echo "rocks" | /opt/rocks/bin/ci /var/log/boot.log;
/opt/rocks/bin/co -f -l /var/log/boot.log;
fi

if [ -f /etc/ld.so.conf.d/ganglia.conf ]; then
echo "rocks" | /opt/rocks/bin/ci /etc/ld.so.conf.d/ganglia.conf;
/opt/rocks/bin/co -f -l /etc/ld.so.conf.d/ganglia.conf;
fi

if [ -f /etc/411.conf ]; then
echo "rocks" | /opt/rocks/bin/ci /etc/411.conf;
/opt/rocks/bin/co -f -l /etc/411.conf;
fi
chown root:root /etc/411.conf
chown root:root /etc/RCS/411.conf,v
chmod 0600 /etc/411.conf

if [ -f /etc/ld.so.conf.d/foundation-mysql.conf ]; then
echo "rocks" | /opt/rocks/bin/ci /etc/ld.so.conf.d/foundation-mysql.conf;
/opt/rocks/bin/co -f -l /etc/ld.so.conf.d/foundation-mysql.conf;
fi

if [ -f /etc/profile.d/java.csh ]; then
echo "rocks" | /opt/rocks/bin/ci /etc/profile.d/java.csh;
/opt/rocks/bin/co -f -l /etc/profile.d/java.csh;
fi
chmod 0755 /etc/profile.d/java.csh

if [ -f /etc/profile.d/rocks-lang.sh ]; then
echo "rocks" | /opt/rocks/bin/ci /etc/profile.d/rocks-lang.sh;
/opt/rocks/bin/co -f -l /etc/profile.d/rocks-lang.sh;
fi
chmod 0755 /etc/profile.d/rocks-lang.sh

if [ -f /etc/sysconfig/static-routes ]; then
echo "rocks" | /opt/rocks/bin/ci /etc/sysconfig/static-routes;
/opt/rocks/bin/co -f -l /etc/sysconfig/static-routes;
fi

if [ -f /opt/torque/server_name ]; then
echo "rocks" | /opt/rocks/bin/ci /opt/torque/server_name;
/opt/rocks/bin/co -f -l /opt/torque/server_name;
fi

if [ -f /etc/ssh/ssh_host_key.pub ]; then
echo "rocks" | /opt/rocks/bin/ci /etc/ssh/ssh_host_key.pub;
/opt/rocks/bin/co -f -l /etc/ssh/ssh_host_key.pub;
fi
chmod 0444 /etc/ssh/ssh_host_key.pub

if [ -f /boot/kickstart/cluster-kickstart-pxe ]; then
echo "rocks" | /opt/rocks/bin/ci /boot/kickstart/cluster-kickstart-pxe;
/opt/rocks/bin/co -f -l /boot/kickstart/cluster-kickstart-pxe;
fi
chown root.wheel /boot/kickstart/cluster-kickstart-pxe
chown root.wheel /boot/kickstart/RCS/cluster-kickstart-pxe,v
chmod u+rwxs,g+rx,o-rwx /boot/kickstart/cluster-kickstart-pxe

if [ -f /etc/pki/tls/certs/localhost.crt ]; then
echo "rocks" | /opt/rocks/bin/ci /etc/pki/tls/certs/localhost.crt;
/opt/rocks/bin/co -f -l /etc/pki/tls/certs/localhost.crt;
fi
chmod 0444 /etc/pki/tls/certs/localhost.crt

if [ -f /etc/hosts ]; then
echo "rocks" | /opt/rocks/bin/ci /etc/hosts;
/opt/rocks/bin/co -f -l /etc/hosts;
fi

if [ -f /opt/rocks/lib/python2.4/site-packages/rocks/__init__.py ]; then
echo "rocks" | /opt/rocks/bin/ci /opt/rocks/lib/python2.4/site-packages/rocks/__init__.py;
/opt/rocks/bin/co -f -l /opt/rocks/lib/python2.4/site-packages/rocks/__init__.py;
fi

if [ -f /etc/yum.conf ]; then
echo "rocks" | /opt/rocks/bin/ci /etc/yum.conf;
/opt/rocks/bin/co -f -l /etc/yum.conf;
fi

if [ -f /etc/profile.d/java.sh ]; then
echo "rocks" | /opt/rocks/bin/ci /etc/profile.d/java.sh;
/opt/rocks/bin/co -f -l /etc/profile.d/java.sh;
fi
chmod 0755 /etc/profile.d/java.sh

if [ -f /etc/ssh/ssh_host_rsa_key ]; then
echo "rocks" | /opt/rocks/bin/ci /etc/ssh/ssh_host_rsa_key;
/opt/rocks/bin/co -f -l /etc/ssh/ssh_host_rsa_key;
fi
chmod 0400 /etc/ssh/ssh_host_rsa_key

if [ -f /etc/sysconfig/selinux ]; then
echo "rocks" | /opt/rocks/bin/ci /etc/sysconfig/selinux;
/opt/rocks/bin/co -f -l /etc/sysconfig/selinux;
fi

if [ -f /etc/postfix/main.cf ]; then
echo "rocks" | /opt/rocks/bin/ci /etc/postfix/main.cf;
/opt/rocks/bin/co -f -l /etc/postfix/main.cf;
fi

if [ -f /etc/rocks-release ]; then
echo "rocks" | /opt/rocks/bin/ci /etc/rocks-release;
/opt/rocks/bin/co -f -l /etc/rocks-release;
fi

if [ -f /tmp/db_partition_info.py ]; then
echo "rocks" | /opt/rocks/bin/ci /tmp/db_partition_info.py;
/opt/rocks/bin/co -f -l /tmp/db_partition_info.py;
fi

if [ -f /var/cluster/frontend ]; then
echo "rocks" | /opt/rocks/bin/ci /var/cluster/frontend;
/opt/rocks/bin/co -f -l /var/cluster/frontend;
fi

if [ -f /etc/resolv.conf ]; then
echo "rocks" | /opt/rocks/bin/ci /etc/resolv.conf;
/opt/rocks/bin/co -f -l /etc/resolv.conf;
fi

if [ -f /etc/pbs.conf ]; then
echo "rocks" | /opt/rocks/bin/ci /etc/pbs.conf;
/opt/rocks/bin/co -f -l /etc/pbs.conf;
fi

if [ -f /etc/cron.hourly/ntp ]; then
echo "rocks" | /opt/rocks/bin/ci /etc/cron.hourly/ntp;
/opt/rocks/bin/co -f -l /etc/cron.hourly/ntp;
fi
chmod 0755 /etc/cron.hourly/ntp

if [ -f /var/log/rocks-install.log ]; then
echo "rocks" | /opt/rocks/bin/ci /var/log/rocks-install.log;
/opt/rocks/bin/co -f -l /var/log/rocks-install.log;
fi

if [ -f /etc/motd ]; then
echo "rocks" | /opt/rocks/bin/ci /etc/motd;
/opt/rocks/bin/co -f -l /etc/motd;
fi

if [ -f /etc/sysconfig/ipmi ]; then
echo "rocks" | /opt/rocks/bin/ci /etc/sysconfig/ipmi;
/opt/rocks/bin/co -f -l /etc/sysconfig/ipmi;
fi
chmod 500 /etc/sysconfig/ipmi

if [ -f /tmp/mdmonitor ]; then
echo "rocks" | /opt/rocks/bin/ci /tmp/mdmonitor;
/opt/rocks/bin/co -f -l /tmp/mdmonitor;
fi

if [ -f /etc/sysconfig/i18n ]; then
echo "rocks" | /opt/rocks/bin/ci /etc/sysconfig/i18n;
/opt/rocks/bin/co -f -l /etc/sysconfig/i18n;
fi

if [ -f /etc/logrotate.d/rocks ]; then
echo "rocks" | /opt/rocks/bin/ci /etc/logrotate.d/rocks;
/opt/rocks/bin/co -f -l /etc/logrotate.d/rocks;
fi

if [ -f /etc/pki/tls/private/localhost.key ]; then
echo "rocks" | /opt/rocks/bin/ci /etc/pki/tls/private/localhost.key;
/opt/rocks/bin/co -f -l /etc/pki/tls/private/localhost.key;
fi
chmod 0400 /etc/pki/tls/private/localhost.key

if [ -f /etc/profile.d/modules.sh ]; then
echo "rocks" | /opt/rocks/bin/ci /etc/profile.d/modules.sh;
/opt/rocks/bin/co -f -l /etc/profile.d/modules.sh;
fi

if [ -f /etc/syslog.conf ]; then
echo "rocks" | /opt/rocks/bin/ci /etc/syslog.conf;
/opt/rocks/bin/co -f -l /etc/syslog.conf;
fi

if [ -f /etc/ntp/step-tickers ]; then
echo "rocks" | /opt/rocks/bin/ci /etc/ntp/step-tickers;
/opt/rocks/bin/co -f -l /etc/ntp/step-tickers;
fi

if [ -f /etc/ld.so.conf ]; then
echo "rocks" | /opt/rocks/bin/ci /etc/ld.so.conf;
/opt/rocks/bin/co -f -l /etc/ld.so.conf;
fi

if [ -f /etc/snmp/snmpd.conf ]; then
echo "rocks" | /opt/rocks/bin/ci /etc/snmp/snmpd.conf;
/opt/rocks/bin/co -f -l /etc/snmp/snmpd.conf;
fi

if [ -f /etc/profile.d/rocks-lang.csh ]; then
echo "rocks" | /opt/rocks/bin/ci /etc/profile.d/rocks-lang.csh;
/opt/rocks/bin/co -f -l /etc/profile.d/rocks-lang.csh;
fi
chmod 0755 /etc/profile.d/rocks-lang.csh

if [ -f /etc/ntp.conf ]; then
echo "rocks" | /opt/rocks/bin/ci /etc/ntp.conf;
/opt/rocks/bin/co -f -l /etc/ntp.conf;
fi

if [ -f /etc/man.config ]; then
echo "rocks" | /opt/rocks/bin/ci /etc/man.config;
/opt/rocks/bin/co -f -l /etc/man.config;
fi

if [ -f /etc/411-security/master.pub ]; then
echo "rocks" | /opt/rocks/bin/ci /etc/411-security/master.pub;
/opt/rocks/bin/co -f -l /etc/411-security/master.pub;
fi
chown root:root /etc/411-security/master.pub
chown root:root /etc/411-security/RCS/master.pub,v
chmod 0444 /etc/411-security/master.pub

if [ -f /etc/rc.d/init.d/mdmonitor ]; then
echo "rocks" | /opt/rocks/bin/ci /etc/rc.d/init.d/mdmonitor;
/opt/rocks/bin/co -f -l /etc/rc.d/init.d/mdmonitor;
fi
chmod 755 /etc/rc.d/init.d/mdmonitor

if [ -f /etc/rpm/macros.rocks ]; then
echo "rocks" | /opt/rocks/bin/ci /etc/rpm/macros.rocks;
/opt/rocks/bin/co -f -l /etc/rpm/macros.rocks;
fi
chmod 0644 /etc/rpm/macros.rocks

if [ -f /etc/profile.d/modules.csh ]; then
echo "rocks" | /opt/rocks/bin/ci /etc/profile.d/modules.csh;
/opt/rocks/bin/co -f -l /etc/profile.d/modules.csh;
fi

if [ -f /etc/postfix/canonical ]; then
echo "rocks" | /opt/rocks/bin/ci /etc/postfix/canonical;
/opt/rocks/bin/co -f -l /etc/postfix/canonical;
fi

if [ -f /root/.ssh/authorized_keys ]; then
echo "rocks" | /opt/rocks/bin/ci /root/.ssh/authorized_keys;
/opt/rocks/bin/co -f -l /root/.ssh/authorized_keys;
fi
chmod 0600 /root/.ssh/authorized_keys

if [ -f /etc/sysctl.conf ]; then
echo "rocks" | /opt/rocks/bin/ci /etc/sysctl.conf;
/opt/rocks/bin/co -f -l /etc/sysctl.conf;
fi

if [ -f /etc/rc.d/rocksconfig.d/pre-09-prep-kernel-source ]; then
echo "rocks" | /opt/rocks/bin/ci /etc/rc.d/rocksconfig.d/pre-09-prep-kernel-source;
/opt/rocks/bin/co -f -l /etc/rc.d/rocksconfig.d/pre-09-prep-kernel-source;
fi
chmod 755 /etc/rc.d/rocksconfig.d/pre-09-prep-kernel-source

if [ -f /etc/rc.d/rocksconfig.d/post-92-mpiselector ]; then
echo "rocks" | /opt/rocks/bin/ci /etc/rc.d/rocksconfig.d/post-92-mpiselector;
/opt/rocks/bin/co -f -l /etc/rc.d/rocksconfig.d/post-92-mpiselector;
fi
chmod 0755 /etc/rc.d/rocksconfig.d/post-92-mpiselector

if [ -f /etc/ssh/ssh_host_dsa_key.pub ]; then
echo "rocks" | /opt/rocks/bin/ci /etc/ssh/ssh_host_dsa_key.pub;
/opt/rocks/bin/co -f -l /etc/ssh/ssh_host_dsa_key.pub;
fi
chmod 0444 /etc/ssh/ssh_host_dsa_key.pub

if [ -f /etc/sysconfig/iptables ]; then
echo "rocks" | /opt/rocks/bin/ci /etc/sysconfig/iptables;
/opt/rocks/bin/co -f -l /etc/sysconfig/iptables;
fi
chmod 500 /etc/sysconfig/iptables

if [ -f /opt/modules/init/.modulespath ]; then
echo "rocks" | /opt/rocks/bin/ci /opt/modules/init/.modulespath;
/opt/rocks/bin/co -f -l /opt/modules/init/.modulespath;
fi

if [ -f /etc/ssh/ssh_config ]; then
echo "rocks" | /opt/rocks/bin/ci /etc/ssh/ssh_config;
/opt/rocks/bin/co -f -l /etc/ssh/ssh_config;
fi

if [ -f /etc/sysconfig/network-scripts/network-functions ]; then
echo "rocks" | /opt/rocks/bin/ci /etc/sysconfig/network-scripts/network-functions;
/opt/rocks/bin/co -f -l /etc/sysconfig/network-scripts/network-functions;
fi

if [ -f /var/cluster/born-on ]; then
echo "rocks" | /opt/rocks/bin/ci /var/cluster/born-on;
/opt/rocks/bin/co -f -l /var/cluster/born-on;
fi

if [ -f /etc/sysconfig/network ]; then
echo "rocks" | /opt/rocks/bin/ci /etc/sysconfig/network;
/opt/rocks/bin/co -f -l /etc/sysconfig/network;
fi

if [ -f /tmp/grub.conf ]; then
echo "rocks" | /opt/rocks/bin/ci /tmp/grub.conf;
/opt/rocks/bin/co -f -l /tmp/grub.conf;
fi

if [ -f /etc/ssh/ssh_host_rsa_key.pub ]; then
echo "rocks" | /opt/rocks/bin/ci /etc/ssh/ssh_host_rsa_key.pub;
/opt/rocks/bin/co -f -l /etc/ssh/ssh_host_rsa_key.pub;
fi
chmod 0444 /etc/ssh/ssh_host_rsa_key.pub

if [ -f /etc/sysconfig/network-scripts/ifcfg-eth2 ]; then
echo "rocks" | /opt/rocks/bin/ci /etc/sysconfig/network-scripts/ifcfg-eth2;
/opt/rocks/bin/co -f -l /etc/sysconfig/network-scripts/ifcfg-eth2;
fi

if [ -f /etc/sysconfig/network-scripts/ifcfg-eth3 ]; then
echo "rocks" | /opt/rocks/bin/ci /etc/sysconfig/network-scripts/ifcfg-eth3;
/opt/rocks/bin/co -f -l /etc/sysconfig/network-scripts/ifcfg-eth3;
fi

if [ -f /etc/sysconfig/network-scripts/ifcfg-eth0 ]; then
echo "rocks" | /opt/rocks/bin/ci /etc/sysconfig/network-scripts/ifcfg-eth0;
/opt/rocks/bin/co -f -l /etc/sysconfig/network-scripts/ifcfg-eth0;
fi

if [ -f /etc/sysconfig/network-scripts/ifcfg-eth1 ]; then
echo "rocks" | /opt/rocks/bin/ci /etc/sysconfig/network-scripts/ifcfg-eth1;
/opt/rocks/bin/co -f -l /etc/sysconfig/network-scripts/ifcfg-eth1;
fi
EOF

cat >> /etc/sysconfig/rocks-post << EOF
EOF

]]>
</section>
</profile>

James Rudd

unread,
Mar 12, 2012, 8:13:35 AM3/12/12
to Discussion of Rocks Clusters
Does anyone have any suggestions on what further debugging steps I can take
to resolve this issue?

At the moment I've been forced to create an hourly cron job to resend out
the shared key so kickstarted nodes will receive it. It does seem to work
but it is not a real solution.

Thanks,
James

URL: https://lists.sdsc.edu/pipermail/npaci-rocks-discussion/attachments/20120312/248e9f47/attachment.html

Scott Roberts

unread,
Mar 12, 2012, 10:15:33 AM3/12/12
to James Rudd, Discussion of Rocks Clusters
Try this:

On the frontend while logged in as root:

service sec-channel restart
rocks sync host sharedkey <server having issue, e.g. compute-0-0>

On the affected node, login as root, then:
411get --all

My workaround for this issue is to add "411get --all" into the <post> section of extend-compute.xml so that it is executed every time a compute node is built.

--Scott

--
Scott Roberts, Senior Systems Administrator
Johns Hopkins University
Human Language Technology Center of Excellence
810 Wyman Park Drive, Baltimore, MD 21211
Phone: 410.516.5567
Fax: 410.516.6700

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2207 bytes
Desc: not available
Url : https://lists.sdsc.edu/pipermail/npaci-rocks-discussion/attachments/20120312/3b0f9352/smime.p7s

Philip Papadopoulos

unread,
Mar 12, 2012, 4:58:57 PM3/12/12
to Discussion of Rocks Clusters
James,
Still trying to figure out why this doesn't work
Can you check if there are zombie processes on your frontend? These would
be from the
sec_channel service.

-P


--
Philip Papadopoulos, PhD
University of California, San Diego
858-822-3628 (Ofc)
619-331-2990 (Fax)


-------------- next part --------------
An HTML attachment was scrubbed...

URL: https://lists.sdsc.edu/pipermail/npaci-rocks-discussion/attachments/20120312/f9416a4b/attachment.html

James Rudd

unread,
Mar 12, 2012, 10:31:21 PM3/12/12
to Scott Roberts, Discussion of Rocks Clusters
Hi Scott,
I can manually run these commands to force the file out, the problem
it has to be done every time a node reinstalls.

At present I have an hourly cron job (below) running to ensure it does get
sent out, but it is not really a fix.
==============
# Sync key and Users
/opt/rocks/bin/rocks sync host sharedkey compute
/opt/rocks/bin/rocks sync users

# make share directory if it does not exist
/opt/rocks/bin/rocks run host compute collate=yes command="[ -d /share ] ||
( mkdir /share && service autofs restart ) "
==============

If I add "411get --all" to the post section it will fail as it returns an
error until "rocks sync host sharedkey compute" is run.

Thanks,
James

URL: https://lists.sdsc.edu/pipermail/npaci-rocks-discussion/attachments/20120313/f82457cd/attachment.html

James Rudd

unread,
Mar 13, 2012, 7:20:40 AM3/13/12
to Philip Papadopoulos, Discussion of Rocks Clusters
Hi Philip,
I've checked with PS and there appear to be no zombie processes. I've also
restarted the Frontend and the problem was still occurring.

I think I've finally identified part of the problem. It appears the file
"/etc/rc.d/rocksconfig.d/post-02-411get" is created and subsequently
removed, even though the shared.key is never received.

Looking at /tmp/post-02-411get.debug it reports:
===============
10.1.1.1: RPC: Port mapper failure - RPC: Unable to receive
/etc/rc.d/rocksconfig.d/post-02-411get: line 16: [: missing `]'
/etc/rc.d/rocksconfig.d/post-02-411get: line 16: -f: command not found
===============

I have created a second copy of post-02-411get using extend-compute.xml and
added a test for shared.key existence before deleting the file and this
appears to have fixed the problem. It appears the 2 min delay
after post-02-411get gives the system time for the RPC Port mapper to work
so when the second copy requests the key it works.
I'm not sure why the test on line 16 failed though.

Thanks Phillip and thanks Scott, your solution was close but needed the
added "/opt/rocks/bin/get-411-key 10.1.1.1" for "411get --all" to work.

Thanks,
James

<file name="/etc/rc.d/rocksconfig.d/post-03-411get" perms="0700">
<![CDATA[
#!/bin/bash

# Tell frontend to send you the 411 shared key
/opt/rocks/bin/get-411-key 10.1.1.1

# Wait 120 seconds for shared key to get populated
for i in {1..12}; do
[ ! -f /etc/411-security/shared.key ] && sleep 10s
done

# If shared key got transferred, do a 411get and pull information
# from frontend

[ -f /etc/411-security/shared.key ] && /opt/rocks/bin/411get --all

if [ -f /etc/rc3.d/S*autofs || -f /etc/rc5.d/S*autofs ]; then
/sbin/service autofs restart
fi

[ -f /etc/411-security/shared.key ] && rm -rf
/etc/rc.d/rocksconfig.d/post-03-411get
]]>
</file>

URL: https://lists.sdsc.edu/pipermail/npaci-rocks-discussion/attachments/20120313/d5a4e242/attachment.html

Larry Baker

unread,
Mar 13, 2012, 3:32:33 PM3/13/12
to Discussion of Rocks Clusters, Philip Papadopoulos
Phil and James,

It may have nothing to do with James' problem, but I can see two
potential problems with the syntax of the /etc/rc.d/rocksconfig.d/
post-03-411get he posted:

line 16:

> if [ -f /etc/rc3.d/S*autofs || -f /etc/rc5.d/S*autofs ]; then

1) the proper operators for compound test ([...]) commands are -a and -
o, not && and || (man test or man sh).
2) "[" and "]" are shell operators. I've had to add spaces around
such syntax in the past. Try separating "];" into "] ;".

Larry Baker
US Geological Survey
650-329-5608
ba...@usgs.gov

Philip Papadopoulos

unread,
Mar 13, 2012, 3:46:24 PM3/13/12
to Larry Baker, Discussion of Rocks Clusters
Probably you mean something like what's in this commit?
http://git.rocksclusters.org/cgi-bin/gitweb.cgi?p=core/base/.git;a=commitdiff;h=836198153534ad9677472a87aeee071574934db6

Thanks,
Phil


On Tue, Mar 13, 2012 at 12:32 PM, Larry Baker <ba...@usgs.gov> wrote:

> Phil and James,
>
> It may have nothing to do with James' problem, but I can see two potential

> problems with the syntax of the /etc/rc.d/rocksconfig.d/post-**03-411get


> he posted:
>
> line 16:
>
>
> if [ -f /etc/rc3.d/S*autofs || -f /etc/rc5.d/S*autofs ]; then
>>
>
> 1) the proper operators for compound test ([...]) commands are -a and -o,
> not && and || (man test or man sh).
> 2) "[" and "]" are shell operators. I've had to add spaces around such
> syntax in the past. Try separating "];" into "] ;".
>
> Larry Baker
> US Geological Survey
> 650-329-5608
> ba...@usgs.gov
>
>
> On 13 Mar 2012, at 4:20 AM, James Rudd wrote:
>
>

>> <file name="/etc/rc.d/rocksconfig.d/**post-03-411get" perms="0700">


>> <![CDATA[
>> #!/bin/bash
>>
>> # Tell frontend to send you the 411 shared key
>> /opt/rocks/bin/get-411-key 10.1.1.1
>>
>> # Wait 120 seconds for shared key to get populated
>> for i in {1..12}; do
>> [ ! -f /etc/411-security/shared.key ] && sleep 10s
>> done
>>
>> # If shared key got transferred, do a 411get and pull information
>> # from frontend
>>
>> [ -f /etc/411-security/shared.key ] && /opt/rocks/bin/411get --all
>>
>> if [ -f /etc/rc3.d/S*autofs || -f /etc/rc5.d/S*autofs ]; then
>> /sbin/service autofs restart
>> fi
>>
>> [ -f /etc/411-security/shared.key ] && rm -rf

>> /etc/rc.d/rocksconfig.d/post-**03-411get
>> ]]>
>> </file>
>>
>>
>


--
Philip Papadopoulos, PhD
University of California, San Diego
858-822-3628 (Ofc)
619-331-2990 (Fax)
-------------- next part --------------
An HTML attachment was scrubbed...

URL: https://lists.sdsc.edu/pipermail/npaci-rocks-discussion/attachments/20120313/e0d79968/attachment.html

Larry Baker

unread,
Mar 13, 2012, 3:57:05 PM3/13/12
to Philip Papadopoulos, Discussion of Rocks Clusters
Yup!

Any idea if "[" and "]" should have spaces around them?

Larry Baker
US Geological Survey
650-329-5608
ba...@usgs.gov

On 13 Mar 2012, at 12:46 PM, Philip Papadopoulos wrote:

> Probably you mean something like what's in this commit?
> http://git.rocksclusters.org/cgi-bin/gitweb.cgi?p=core/base/.git;a=commitdiff;h=836198153534ad9677472a87aeee071574934db6
>
> Thanks,
> Phil
>
>
> On Tue, Mar 13, 2012 at 12:32 PM, Larry Baker <ba...@usgs.gov> wrote:
> Phil and James,
>
> It may have nothing to do with James' problem, but I can see two
> potential problems with the syntax of the /etc/rc.d/rocksconfig.d/

> post-03-411get he posted:


>
> line 16:
>
>
> if [ -f /etc/rc3.d/S*autofs || -f /etc/rc5.d/S*autofs ]; then
>
> 1) the proper operators for compound test ([...]) commands are -a
> and -o, not && and || (man test or man sh).
> 2) "[" and "]" are shell operators. I've had to add spaces around
> such syntax in the past. Try separating "];" into "] ;".
>
> Larry Baker
> US Geological Survey
> 650-329-5608
> ba...@usgs.gov
>
>
> On 13 Mar 2012, at 4:20 AM, James Rudd wrote:
>
>

> <file name="/etc/rc.d/rocksconfig.d/post-03-411get" perms="0700">


> <![CDATA[
> #!/bin/bash
>
> # Tell frontend to send you the 411 shared key
> /opt/rocks/bin/get-411-key 10.1.1.1
>
> # Wait 120 seconds for shared key to get populated
> for i in {1..12}; do
> [ ! -f /etc/411-security/shared.key ] && sleep 10s
> done
>
> # If shared key got transferred, do a 411get and pull information
> # from frontend
>
> [ -f /etc/411-security/shared.key ] && /opt/rocks/bin/411get --all
>
> if [ -f /etc/rc3.d/S*autofs || -f /etc/rc5.d/S*autofs ]; then
> /sbin/service autofs restart
> fi
>
> [ -f /etc/411-security/shared.key ] && rm -rf

> /etc/rc.d/rocksconfig.d/post-03-411get


> ]]>
> </file>
>
>
>
>
>
> --
> Philip Papadopoulos, PhD
> University of California, San Diego
> 858-822-3628 (Ofc)
> 619-331-2990 (Fax)

-------------- next part --------------
An HTML attachment was scrubbed...

URL: https://lists.sdsc.edu/pipermail/npaci-rocks-discussion/attachments/20120313/94b8f453/attachment.html

James Rudd

unread,
Mar 13, 2012, 7:01:19 PM3/13/12
to Discussion of Rocks Clusters
Thanks Larry, I made the 2 changes to my file and now there are no errors
in the debug log.

I'm still not sure why the first attempt receives "RPC: Port mapper failure
- RPC: Unable to receive" but at least it is working now.

Thanks,
James


On Wed, Mar 14, 2012 at 6:57 AM, Larry Baker <ba...@usgs.gov> wrote:

> Yup!
>
> Any idea if "[" and "]" should have spaces around them?
>
> Larry Baker
> US Geological Survey
> 650-329-5608
> ba...@usgs.gov
>
>

-------------- next part --------------
An HTML attachment was scrubbed...

URL: https://lists.sdsc.edu/pipermail/npaci-rocks-discussion/attachments/20120314/90024bbd/attachment.html

Reply all
Reply to author
Forward
0 new messages