#! /bin/bash # This is the cluster startup scripts installation program # for Debian Potato INITSCRIPT_DIR=`pwd`/debian-init-scripts INSTALL=/usr/bin/install if [ -d /etc/network ]; then if [ ! -d /cluster/{nodenum}/etc/network ];then mkdir -p /cluster/{nodenum}/etc mv /etc/network /cluster/{nodenum}/etc/network ln -s /cluster/{nodenum}/etc/network /etc/network fi echo " " echo "For each node in the cluster " echo " eg: cp -a /cluster/{nodenum}/etc/network /cluster/nodenum1/etc/network => for node 1 " echo " " read junk fi if [ -d /var/run ]; then if [ ! -d /cluster/{nodenum}/var/run ]; then mkdir -p /cluster/{nodenum}/var/ mv /var/run /cluster/{nodenum}/var/run ln -s /cluster/{nodenum}/var/run /var/run fi echo " " echo "For each node in the cluster " echo " eg: cp -a /cluster/{nodenum}/var/run /cluster/nodenum1/var/run => for node 1 " echo " " read junk fi if [ -d /var/lock ]; then if [ ! -d /cluster/{nodenum}/var/lock ]; then mkdir -p /cluster/{nodenum}/var/ mv /var/lock /cluster/{nodenum}/var/lock ln -s /cluster/{nodenum}/var/lock /var/lock fi echo " " echo "For each node in the cluster " echo " eg: cp -a /cluster/{nodenum}/var/lock /cluster/nodenum1/var/lock => for node 1 " echo " " read junk fi if [ -d /var/log ]; then if [ ! -d /cluster/{nodenum}/var/log ]; then mkdir -p /cluster/{nodenum}/var/ mv /var/log /cluster/{nodenum}/var/log ln -s /cluster/{nodenum}/var/log /var/log fi echo " " echo "For each node in the cluster " echo " eg: cp -a /cluster/{nodenum}/var/log /cluster/nodenum1/var/log => for node 1 " echo " " read junk fi #Create the cluster hostname file. echo -n "Enter the cluster hostname: " read clustername # Create the new file with the same permission cp -d /etc/hostname /etc/clustername echo $clustername >/etc/clustername #Create nodename file. echo "Creating nodename file " cp -d /etc/hostname /cluster/{nodenum}/etc/nodename ln -s /cluster/{nodenum}/etc/nodename /etc/nodename echo " " echo "For each node in the cluster " echo " eg: cp -a /cluster/{nodenum}/etc/nodename /cluster/nodenum1/etc/nodename => for node 1 " echo " " read junk # Take a backup so that cluster uninstall can copy the old one back if [ -f /etc/init.d/hostname.sh ]; then cp /etc/init.d/hostname.sh /etc/init.d/hostname.sh.old $INSTALL -o root -g root -m 755 $INITSCRIPT_DIR/hostname.sh /etc/init.d/hostname.sh fi #Install Cluster run level script and files $INSTALL -o root -g root -m 755 $INITSCRIPT_DIR/rcSSI /etc/init.d/rcSSI $INSTALL -o root -g root -m 755 -d /etc/rcSSI.d # Now installing the symbolic links and cluster modified files cp -d /etc/rcS.d/* /etc/rcSSI.d/ # remove cluster specific files rm -f /etc/rcSSI.d/S10checkroot.sh rm -f /etc/rcSSI.d/S35mountall.sh rm -f /etc/rcSSI.d/S30checkfs.sh # Install the new modified files $INSTALL -o root -g root -m 755 $INITSCRIPT_DIR/S10checkroot.sh /etc/rcSSI.d/S10checkroot.sh $INSTALL -o root -g root -m 755 $INITSCRIPT_DIR/S35mountall.sh /etc/rcSSI.d/S35mountall.sh # Create additional links ln -s /etc/init.d/rmnologin /etc/rcSSI.d/S99rmnologin