summaryrefslogtreecommitdiffstats
path: root/base/root/scripts
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2008-07-11 15:22:11 +1000
committerAndrew Tridgell <tridge@samba.org>2008-07-11 15:22:11 +1000
commita1336eddefa0626652bba89be4de0ecfba59fe30 (patch)
tree8a7de4a93079ae04562f5fb5c15427d611761590 /base/root/scripts
parent221b3b60fb4f25692d514e9f64e319b3a9d29523 (diff)
downloadautocluster-a1336eddefa0626652bba89be4de0ecfba59fe30.tar.gz
autocluster-a1336eddefa0626652bba89be4de0ecfba59fe30.tar.xz
autocluster-a1336eddefa0626652bba89be4de0ecfba59fe30.zip
automate setting the password in TSM client
Diffstat (limited to 'base/root/scripts')
-rwxr-xr-xbase/root/scripts/mknsd.sh2
-rwxr-xr-xbase/root/scripts/setup_gpfs.sh3
-rwxr-xr-xbase/root/scripts/setup_tsm_client.sh34
-rwxr-xr-xbase/root/scripts/setup_tsm_server.sh18
4 files changed, 49 insertions, 8 deletions
diff --git a/base/root/scripts/mknsd.sh b/base/root/scripts/mknsd.sh
index 583846c..304225e 100755
--- a/base/root/scripts/mknsd.sh
+++ b/base/root/scripts/mknsd.sh
@@ -1,5 +1,7 @@
#!/bin/sh
+set -e
+
disks=`/var/mmfs/etc/nsddevices | awk '{print $1}'`
(
for d in $disks; do
diff --git a/base/root/scripts/setup_gpfs.sh b/base/root/scripts/setup_gpfs.sh
index e1c9c04..7f80f57 100755
--- a/base/root/scripts/setup_gpfs.sh
+++ b/base/root/scripts/setup_gpfs.sh
@@ -43,7 +43,8 @@ mmgetstate -a
echo
echo "Creating filesystem"
-mkdir /gpfs
+mkdir -p /gpfs/automountdir
+
chattr +i /gpfs
mmcrfs gpfs0 -F $nsdfile -A yes -D nfs4 -B 64k -k nfs4 -n 32 -E yes -S no -T /gpfs
diff --git a/base/root/scripts/setup_tsm_client.sh b/base/root/scripts/setup_tsm_client.sh
index 4b1c920..48e096c 100755
--- a/base/root/scripts/setup_tsm_client.sh
+++ b/base/root/scripts/setup_tsm_client.sh
@@ -1,6 +1,8 @@
#!/bin/bash
-onnode all yum -y install TIVsm-BA TIVsm-HSM TIVsm-API
+set -e
+
+onnode all yum -y install TIVsm-BA TIVsm-HSM TIVsm-API expect
echo "Setting up dsm.sys"
cat <<EOF > /opt/tivoli/tsm/client/ba/bin/dsm.sys
@@ -22,15 +24,41 @@ EOF
onnode all rsync $HOSTNAME:/opt/tivoli/tsm/client/ba/bin/dsm.opt /opt/tivoli/tsm/client/ba/bin
onnode all "preprpnode `hostname -s`"
-mkrpdomain -F /etc/ctdb/nodes SOFSDomain
+mkrpdomain -F /etc/ctdb/nodes @@CLUSTER@@
+
+echo "Setting TSM password"
+cat <<EOF > /tmp/tsmpwd
+spawn dsmsetpw
+expect "enter password"
+send "admin
+"
+sleep 2
+EOF
+onnode all "rsync $HOSTNAME:/tmp/tsmpwd /tmp/; expect /tmp/tsmpwd"
+onnode all rm -f /tmp/tsmpwd
# we have to use a rather torturous procedure ...
+echo "Killing ctdb"
onnode all killall ctdbd
+
+echo "temporarily disabling automount of gpfs0"
mmchfs gpfs0 -A no
+
+echo "Shutting down gpfs"
mmshutdown -a
-mmstartup -a
+
+echo "Starting up gpfs again"
+mstartup -a
+
+echo "Enabling DMAPI in gpfs"
mmchfs gpfs0 -z yes
+
+echo "enabling automount of gpfs0"
mmchfs gpfs0 -A yes
+
+echo "Enabling DMAPI in gpfs"
mmmount gpfs0 -a
dsmmigfs add /gpfs
+
+echo "TSM client setup complete"
diff --git a/base/root/scripts/setup_tsm_server.sh b/base/root/scripts/setup_tsm_server.sh
index 9417cec..9365e03 100755
--- a/base/root/scripts/setup_tsm_server.sh
+++ b/base/root/scripts/setup_tsm_server.sh
@@ -1,19 +1,27 @@
#!/bin/bash
+set -e
+
CLUSTER=@@CLUSTER@@
-yum -y install TIVsm-BA TIVsm-HSM TIVsm-API TIVsm-server || exit 1
+# we don't want multipath using the /dev/sdb device
+echo "Disabling multipath"
+chkconfig multipathd off
+service multipathd stop
+multipath -F
+
+yum -y install TIVsm-BA TIVsm-HSM TIVsm-API TIVsm-server
-mkfs.ext3 -F /dev/sdb || exit 1
+mkfs.ext3 -F /dev/sdb
mkdir -p /tsmdiskpool
cat <<EOF >> /etc/fstab
/dev/sdb /tsmdiskpool ext3 defaults 1 1
EOF
-mount /tsmdiskpool || exit 1
+mount /tsmdiskpool
ln -sf /opt/tivoli/tsm/server/bin/dsmserv.rc /etc/init.d/dsmserv
ln -sf /etc/init.d/dsmserv /etc/rc3.d/S99dsmserv
-/etc/init.d/dsmserv start || exit 1
+/etc/init.d/dsmserv start
echo "Setting up dsm.sys"
cat <<EOF > /opt/tivoli/tsm/client/ba/bin/dsm.sys
@@ -65,3 +73,5 @@ def vol archivepool /tsmdiskpool/archive1.dsm format=@@TSM_ACRHIVE_POOL_SIZE@@ w
del vol /opt/tivoli/tsm/server/bin/archive.dsm
y
EOF
+
+echo "TSM server setup complete"