From 2fe32255f3543d5b56a065bddd517ce0ac9fdc0d Mon Sep 17 00:00:00 2001 From: Martin Schwenke Date: Wed, 17 Sep 2008 21:03:46 +1000 Subject: New base script template /root/scripts/postinstall.sh replaces /root/postinstall.sh. This has also been removed from the 1.5 kickstart template and gets substituted in via new config option KICKSTART_TEMPLATE, which should be set to /dev/null if none of the fancy kickstart post-install magic is required. chkconfig and start of ntpd moved to setup_samba.sh. Also added chkconfig for ctdb there. Added to default value of EXTRA_PACKAGES: openldap-devel, -scsi-target-utils, -xorg-x11-drivers, -xorg-x11-server-Xorg. New yum repo templates: SoFS-1.5.1.repo, SoFS-1.6.repo, SoFS-daily.repo. Updated SoFS-1.5.repo to use SoFS-1.5-Stable and removed SoFS-daily from it. made kickstart-1.5.cfg as consistent as possible with the official SoFS version... and duplicated it to kickstart-1.5.1.cfg. Signed-off-by: Martin Schwenke --- base/root/scripts/conf.base | 6 ++-- base/root/scripts/postinstall.sh | 68 ++++++++++++++++++++++++++++++++++++++++ base/root/scripts/setup_samba.sh | 13 ++++---- 3 files changed, 78 insertions(+), 9 deletions(-) create mode 100644 base/root/scripts/postinstall.sh (limited to 'base/root/scripts') diff --git a/base/root/scripts/conf.base b/base/root/scripts/conf.base index 1a7942f..c9121d5 100644 --- a/base/root/scripts/conf.base +++ b/base/root/scripts/conf.base @@ -462,8 +462,10 @@ logfacility=LOG_USER [/etc/httpd/conf.d/shares.config] - RewriteRule "^/data(.*)$" "/gpfs/data$1" [PT] - ScriptAliasMatch "^/gpfs/data" "/var/www/cgi-bin/browse.cgi" + ScriptAlias "/gpfs/data" "/var/www/cgi-bin/browse.cgi" + RewriteRule ^/data(.*)$ "/gpfs/data$1" [R] + + [/etc/vsftpd/vsftpd.conf] # no anon access diff --git a/base/root/scripts/postinstall.sh b/base/root/scripts/postinstall.sh new file mode 100644 index 0000000..51dec67 --- /dev/null +++ b/base/root/scripts/postinstall.sh @@ -0,0 +1,68 @@ +#!/bin/bash + +echo "setting up SoFS repos" + +cat << EOF > /etc/yum.repos.d/SOFS.repo +@@YUM_REPOS@@ +EOF + + +# install the SoFS packages via a proxy on the host +[ "@@WEBPROXY@@" = "" ] || { + http_proxy=@@WEBPROXY@@ + export http_proxy +} + +echo "Using web proxy: \$http_proxy" + +# force up the network, as kickstart may not have started it +/sbin/ifconfig eth0 @@IPBASE@@.0.@@FIRSTIP@@ up +/sbin/route add default gw @@GATEWAY@@ +/sbin/ifconfig -a +/sbin/route -n + + +cat << EOF > /etc/resolv.conf +domain @@DOMAIN@@ +search @@DNSSEARCH@@ +nameserver @@NAMESERVER@@ +EOF + +echo "Updating from SoFS repositories" +yum -y update + +echo "Trying install of scsi-target-utils" +yum -y install scsi-target-utils + +# we have to force the base GPFS package first, due to the way gpfs updates work +echo "Installing GPFS base" +yum -y install gpfs.base-3.2.0-0.x86_64 + +# then update it + +echo "Updating GPFS base" +yum -y update + +echo "Installing SoFS packages" +yum -y install sofs-base sofs-toolset sofs-gpfs-gui sofs-stats-gui sofs-wizards sofs-space-gui sofs-common + +echo "Installing ctdb packages" +yum -y install ctdb ctdb-debuginfo + +echo "Installing samba packages" +yum -y install samba samba-debuginfo samba-client samba-doc samba-winbind-32bit + +echo "Installing remaining GPFS packages" +yum -y install gpfs.src gpfs.msg gpfs.docs gpfs.gpl gpfs.msg.en_US + +echo "Installing SMutil" +yum -y install SMutil + +echo "Installing ipvsadm" +yum -y install ipvsadm + +echo "Rebuilding the GPFS modules" +(cd /usr/lpp/mmfs/src && make Autoconfig World InstallImages) + +# the TSM packages cause trouble with auto-install +# yum -y install TIVsm-API TIVsm-HSM TIVsm-BA diff --git a/base/root/scripts/setup_samba.sh b/base/root/scripts/setup_samba.sh index 44e97e5..dc3855c 100755 --- a/base/root/scripts/setup_samba.sh +++ b/base/root/scripts/setup_samba.sh @@ -54,6 +54,10 @@ while true ; do esac done +echo "Enabling NTP and ensuring it is started" +run_onnode all chkconfig ntpd on +run_onnode all service ntpd restart + mmgetstate | grep active > /dev/null || { echo "GPFS must be running to setup Samba" exit 1 @@ -67,7 +71,8 @@ cat < /etc/samba/smb.conf clustering = yes EOF -echo "Restarting ctdb" +echo "Enabling and restarting ctdb" +run_onnode all chkconfig ctdb on run_onnode all "service ctdb restart > /dev/null" echo "Waiting for ctdb to enter normal mode" @@ -85,12 +90,6 @@ sofs conf restore "$conf_file" echo "Forcing config reload" sofs conf reload -echo "Fixing scp and ftp jails" -onnode -p all /opt/IBM/sofs/scripts/cnjailgen /var/opt/IBM/sofs/scproot -onnode -p all /opt/IBM/sofs/scripts/cnjailgen /var/opt/IBM/sofs/ftproot -ln -f /lib64/libnss_winbind* /var/opt/IBM/sofs/scproot/lib64/ -ln -f /lib64/libnss_winbind* /var/opt/IBM/sofs/ftproot/lib64/ - echo "Joining domain" net ads join -U"$domain_auth" -- cgit From 8dac6acf9c42ff25ab4354258e5ac1027c224dac Mon Sep 17 00:00:00 2001 From: Martin Schwenke Date: Wed, 17 Sep 2008 23:08:19 +1000 Subject: Move the forced network configuration from postinstall.sh to a separate template that only gets included in the kickstart templates. Take openldap-devel and -scsi-target-utils out of EXTRA_PACKAGES - you can't change a previous selection. setup_base needs to call setup_indirects, since postinstall.sh needs YUM_REPOS. Add a 2nd network interface to install.xml (and bootbase.xml), so we can keep the 2nd network interface specified in the kickstart template. Fix some stuff in the kickstart templates, comment out some things that don't work, add AUTOCLUSTER_POSTINSTALL. Signed-off-by: Martin Schwenke --- base/root/scripts/postinstall.sh | 22 ---------------------- 1 file changed, 22 deletions(-) mode change 100644 => 100755 base/root/scripts/postinstall.sh (limited to 'base/root/scripts') diff --git a/base/root/scripts/postinstall.sh b/base/root/scripts/postinstall.sh old mode 100644 new mode 100755 index 51dec67..a6730c4 --- a/base/root/scripts/postinstall.sh +++ b/base/root/scripts/postinstall.sh @@ -6,28 +6,6 @@ cat << EOF > /etc/yum.repos.d/SOFS.repo @@YUM_REPOS@@ EOF - -# install the SoFS packages via a proxy on the host -[ "@@WEBPROXY@@" = "" ] || { - http_proxy=@@WEBPROXY@@ - export http_proxy -} - -echo "Using web proxy: \$http_proxy" - -# force up the network, as kickstart may not have started it -/sbin/ifconfig eth0 @@IPBASE@@.0.@@FIRSTIP@@ up -/sbin/route add default gw @@GATEWAY@@ -/sbin/ifconfig -a -/sbin/route -n - - -cat << EOF > /etc/resolv.conf -domain @@DOMAIN@@ -search @@DNSSEARCH@@ -nameserver @@NAMESERVER@@ -EOF - echo "Updating from SoFS repositories" yum -y update -- cgit From ff9a3348e9f36d0063042af2dfa0fb26642225fe Mon Sep 17 00:00:00 2001 From: Martin Schwenke Date: Thu, 18 Sep 2008 12:15:20 +1000 Subject: New option WITH_SOFS_GUI can be set to 0 to avoid installation of the GUI packages. New option EXTRA_KERNEL_OPTIONS can be used to pass extra options to the kernel when booting nodes. Removed unneeded comments from config.default. Signed-off-by: Martin Schwenke --- base/root/scripts/postinstall.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'base/root/scripts') diff --git a/base/root/scripts/postinstall.sh b/base/root/scripts/postinstall.sh index a6730c4..8335155 100755 --- a/base/root/scripts/postinstall.sh +++ b/base/root/scripts/postinstall.sh @@ -22,7 +22,12 @@ echo "Updating GPFS base" yum -y update echo "Installing SoFS packages" -yum -y install sofs-base sofs-toolset sofs-gpfs-gui sofs-stats-gui sofs-wizards sofs-space-gui sofs-common +yum -y install sofs-toolset +if [ "@@WITH_SOFS_GUI@@" = 1 ] ; then + yum -y install sofs-base sofs-gpfs-gui sofs-stats-gui sofs-wizards sofs-space-gui sofs-common +else + echo "Skipping installation of SoFS GUI packages" +fi echo "Installing ctdb packages" yum -y install ctdb ctdb-debuginfo -- cgit From 9c11380c25d9c80d31b4e1cfac0771ea3ee44ac7 Mon Sep 17 00:00:00 2001 From: Martin Schwenke Date: Fri, 19 Sep 2008 21:11:06 +1000 Subject: Put back the chroot jail fixes and httpd config changes that somehow disappeared. Signed-off-by: Martin Schwenke --- base/root/scripts/conf.base | 6 ++---- base/root/scripts/setup_samba.sh | 6 ++++++ 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'base/root/scripts') diff --git a/base/root/scripts/conf.base b/base/root/scripts/conf.base index c9121d5..1a7942f 100644 --- a/base/root/scripts/conf.base +++ b/base/root/scripts/conf.base @@ -462,10 +462,8 @@ logfacility=LOG_USER [/etc/httpd/conf.d/shares.config] - ScriptAlias "/gpfs/data" "/var/www/cgi-bin/browse.cgi" - RewriteRule ^/data(.*)$ "/gpfs/data$1" [R] - - + RewriteRule "^/data(.*)$" "/gpfs/data$1" [PT] + ScriptAliasMatch "^/gpfs/data" "/var/www/cgi-bin/browse.cgi" [/etc/vsftpd/vsftpd.conf] # no anon access diff --git a/base/root/scripts/setup_samba.sh b/base/root/scripts/setup_samba.sh index dc3855c..f8f533d 100755 --- a/base/root/scripts/setup_samba.sh +++ b/base/root/scripts/setup_samba.sh @@ -90,6 +90,12 @@ sofs conf restore "$conf_file" echo "Forcing config reload" sofs conf reload +echo "Fixing scp and ftp jails" +onnode -p all /opt/IBM/sofs/scripts/cnjailgen /var/opt/IBM/sofs/scproot +onnode -p all /opt/IBM/sofs/scripts/cnjailgen /var/opt/IBM/sofs/ftproot +ln -f /lib64/libnss_winbind* /var/opt/IBM/sofs/scproot/lib64/ +ln -f /lib64/libnss_winbind* /var/opt/IBM/sofs/ftproot/lib64/ + echo "Joining domain" net ads join -U"$domain_auth" -- cgit From 65fd72d76d37cd0045671ac54369cf5e5d144ec5 Mon Sep 17 00:00:00 2001 From: Martin Schwenke Date: Wed, 24 Sep 2008 11:25:00 +1000 Subject: Add base file /root/scripts/functions. setup_samba.sh now properly waits for a completely healthy cluster. chroot jail generation goes after winbind start. We also no longer try to fix the jail - assume a working cnjailgen is hacked in via some other process. Signed-off-by: Martin Schwenke --- base/root/scripts/functions | 33 +++++++++++++++++++++++++++++++++ base/root/scripts/setup_samba.sh | 27 ++++++++++++--------------- 2 files changed, 45 insertions(+), 15 deletions(-) create mode 100644 base/root/scripts/functions (limited to 'base/root/scripts') diff --git a/base/root/scripts/functions b/base/root/scripts/functions new file mode 100644 index 0000000..be320fe --- /dev/null +++ b/base/root/scripts/functions @@ -0,0 +1,33 @@ +# Hey Emacs, this is a -*- shell-script -*- In fact, it is bash! :-) + +cluster_is_healthy () +{( + set -o pipefail + { ctdb -Y status || return 1 ; } | + { + read x + count=0 + while read line ; do + count=$(($count + 1)) + [ "${line#:*:*:}" != "0:0:0:0:" ] && cat >/dev/null && return 1 + done + [ $count -gt 0 ] && return $? + } +)} + +wait_until_healthy () +{ + local timeout="${1:-120}" + + while [ $timeout -gt 0 ] ; do + if cluster_is_healthy ; then + echo . + return 0 + fi + echo -n . + timeout=$(($timeout - 1)) + sleep 1 + done + + return 1 +} diff --git a/base/root/scripts/setup_samba.sh b/base/root/scripts/setup_samba.sh index f8f533d..bc57fc8 100755 --- a/base/root/scripts/setup_samba.sh +++ b/base/root/scripts/setup_samba.sh @@ -12,6 +12,8 @@ trap 'es=$?; domain_auth="administrator" conf_file="/root/scripts/conf.base" +. /root/scripts/functions + ###################################### # run an onnode - using -p if possible run_onnode() { @@ -75,9 +77,8 @@ echo "Enabling and restarting ctdb" run_onnode all chkconfig ctdb on run_onnode all "service ctdb restart > /dev/null" -echo "Waiting for ctdb to enter normal mode" -while ! ctdb status | grep NORMAL > /dev/null; do echo -n "."; sleep 1; done -echo +echo "Waiting for cluster to become healthy" +wait_until_healthy echo "Starting smbd to initialise registry" /usr/sbin/smbd -D @@ -90,28 +91,24 @@ sofs conf restore "$conf_file" echo "Forcing config reload" sofs conf reload -echo "Fixing scp and ftp jails" -onnode -p all /opt/IBM/sofs/scripts/cnjailgen /var/opt/IBM/sofs/scproot -onnode -p all /opt/IBM/sofs/scripts/cnjailgen /var/opt/IBM/sofs/ftproot -ln -f /lib64/libnss_winbind* /var/opt/IBM/sofs/scproot/lib64/ -ln -f /lib64/libnss_winbind* /var/opt/IBM/sofs/ftproot/lib64/ - echo "Joining domain" net ads join -U"$domain_auth" echo "Restarting ctdb" run_onnode all "service ctdb restart > /dev/null" -echo "Waiting for ctdb to enter normal mode" -while ! ctdb status | grep NORMAL > /dev/null; do echo -n "."; sleep 1; done -echo +echo "Waiting for cluster to become healthy" +wait_until_healthy # why is this needed? Samba doesn't come up the first time?? echo "Restarting ctdb again" run_onnode all "service ctdb restart > /dev/null" -echo "Waiting for ctdb to enter normal mode" -while ! ctdb status | grep NORMAL > /dev/null; do echo -n "."; sleep 1; done -echo +echo "Waiting for cluster to become healthy" +wait_until_healthy + +echo "Ensuring scp and ftp jails are setup" +onnode -p all /opt/IBM/sofs/scripts/cnjailgen /var/opt/IBM/sofs/scproot +onnode -p all /opt/IBM/sofs/scripts/cnjailgen /var/opt/IBM/sofs/ftproot echo "Setup done" -- cgit From 773e427d11ecff275f88ae0f704a139da0d3e9fb Mon Sep 17 00:00:00 2001 From: Martin Schwenke Date: Wed, 24 Sep 2008 11:35:55 +1000 Subject: setup_samba.sh needs to say #!/bin/bash, as does anything that calls cluster_is_healthy. Signed-off-by: Martin Schwenke --- base/root/scripts/setup_samba.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'base/root/scripts') diff --git a/base/root/scripts/setup_samba.sh b/base/root/scripts/setup_samba.sh index bc57fc8..0ae0165 100755 --- a/base/root/scripts/setup_samba.sh +++ b/base/root/scripts/setup_samba.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # this sets up Samba without using the GUI. It is meant as a quick way to get setup # with an autocluster system -- cgit From 0b2851d8f9efd4b471f67e6964c942e2adca24c0 Mon Sep 17 00:00:00 2001 From: Martin Schwenke Date: Wed, 1 Oct 2008 16:47:02 +1000 Subject: setup_samba.sh waits 10 seconds, not until healthy, before 2nd ctdb restart. Signed-off-by: Martin Schwenke --- base/root/scripts/setup_samba.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'base/root/scripts') diff --git a/base/root/scripts/setup_samba.sh b/base/root/scripts/setup_samba.sh index 0ae0165..16b2c6e 100755 --- a/base/root/scripts/setup_samba.sh +++ b/base/root/scripts/setup_samba.sh @@ -97,8 +97,8 @@ net ads join -U"$domain_auth" echo "Restarting ctdb" run_onnode all "service ctdb restart > /dev/null" -echo "Waiting for cluster to become healthy" -wait_until_healthy +echo "Waiting for a few seconds..." +sleep 10 # why is this needed? Samba doesn't come up the first time?? echo "Restarting ctdb again" -- cgit From 3766b1252f59cbbd6b91cd2c5ccc0bb778dc9c3f Mon Sep 17 00:00:00 2001 From: Martin Schwenke Date: Wed, 1 Oct 2008 20:35:08 +1000 Subject: Update the httpexports section as well as /etc/httpd/conf.d/shares.config to fix HTTP. Miscellanous additions to match what the GUI does: idmap:cache = no, wide links = no, CTDB_MANAGES_GPFS = yes, DAEMON_CORE_LIMIT = unlimited. Signed-off-by: Martin Schwenke --- base/root/scripts/conf.base | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'base/root/scripts') diff --git a/base/root/scripts/conf.base b/base/root/scripts/conf.base index 1a7942f..3bc9d34 100644 --- a/base/root/scripts/conf.base +++ b/base/root/scripts/conf.base @@ -45,9 +45,9 @@ data=/gpfs/data [httpexports] - ScriptAlias "/gpfs/data" "/var/www/cgi-bin/browse.cgi" - RewriteRule ^/data(.*)$ "/gpfs/data$1" [R] - + ScriptAliasMatch "^/gpfs/data" "/var/www/cgi-bin/browse.cgi" + RewriteRule "^/data(.*)$" "/gpfs/data$1" [PT] + [nfsexports] "/gpfs/data" *(rw,no_root_squash,fsid=834258092) @@ -72,6 +72,7 @@ gpfs:leases = yes passdb backend = tdbsam idmap backend = tdb2 + idmap:cache = no security = ADS preferred master = no idmap gid = 10000000-11000000 @@ -83,6 +84,7 @@ vfs objects = shadow_copy2 syncops gpfs fileid shadow:snapdir = .snapshots shadow:fixinodes = yes + wide links = no auth methods = guest sam winbind smbd:backgroundqueue = False read only = no @@ -222,10 +224,13 @@ # should ctdb manage starting/stopping the winbind service for you? # default is autodetect CTDB_MANAGES_WINBIND=yes + # should ctdb monitor GPFS filesystems and disks + CTDB_MANAGES_GPFS=yes # you may wish to raise the file descriptor limit for ctdb # use a ulimit command here. ctdb needs one file descriptor per # connected client (ie. one per connected client in Samba) ulimit -n 10000 + DAEMON_COREFILE_LIMIT="unlimited" # the NODES file must be specified or ctdb won't start # it should contain a list of IPs that ctdb will use # it must be exactly the same on all cluster nodes @@ -462,8 +467,8 @@ logfacility=LOG_USER [/etc/httpd/conf.d/shares.config] - RewriteRule "^/data(.*)$" "/gpfs/data$1" [PT] ScriptAliasMatch "^/gpfs/data" "/var/www/cgi-bin/browse.cgi" + RewriteRule "^/data(.*)$" "/gpfs/data$1" [PT] [/etc/vsftpd/vsftpd.conf] # no anon access -- cgit From bc86c0a1d5c9f1daeffa7b96a40fe35d357b0017 Mon Sep 17 00:00:00 2001 From: Martin Schwenke Date: Thu, 2 Oct 2008 20:44:02 +1000 Subject: setup_samba.sh tries even harder to make the cluster healthy. Signed-off-by: Martin Schwenke --- base/root/scripts/setup_samba.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'base/root/scripts') diff --git a/base/root/scripts/setup_samba.sh b/base/root/scripts/setup_samba.sh index 16b2c6e..eb3eaff 100755 --- a/base/root/scripts/setup_samba.sh +++ b/base/root/scripts/setup_samba.sh @@ -98,12 +98,20 @@ echo "Restarting ctdb" run_onnode all "service ctdb restart > /dev/null" echo "Waiting for a few seconds..." -sleep 10 +sleep 20 # why is this needed? Samba doesn't come up the first time?? echo "Restarting ctdb again" run_onnode all "service ctdb restart > /dev/null" +# let's hit this with a big hammer... +for i in $(seq 1 5) ; do + echo "Waiting until healthy" + wait_until_healthy 60 && break + echo "Nope, restart ctdb again..." + run_onnode all "service ctdb restart > /dev/null" +done + echo "Waiting for cluster to become healthy" wait_until_healthy -- cgit