diff options
author | Shireesh Anjal <shireesh@gluster.com> | 2011-11-29 17:54:14 +0530 |
---|---|---|
committer | Shireesh Anjal <shireesh@gluster.com> | 2011-11-29 17:55:52 +0530 |
commit | de1cc28b783ea90122c7f7b6cfb13567f884a696 (patch) | |
tree | a6ef2be8f52e99d41c2d661b70eb0c0361989799 | |
parent | d52cd4039a185e1ac5e8d6a84c4b5dcccfe12375 (diff) |
Introduced gateway backend installation script and modified build script to package it.
Also corrected typos in copyright notice.
-rwxr-xr-x | build/create-rpms.sh | 22 | ||||
-rw-r--r-- | build/glustermg.spec | 4 | ||||
-rwxr-xr-x | build/gmc-buckminster.commands | 23 | ||||
-rwxr-xr-x | build/gmc-build.sh | 22 | ||||
-rwxr-xr-x | build/gmg-backend-install.sh | 131 | ||||
-rwxr-xr-x | build/gmg-buckminster.commands | 22 | ||||
-rwxr-xr-x | build/gmg-install.sh | 30 | ||||
-rwxr-xr-x | build/junit-buckminster.commands | 22 | ||||
-rwxr-xr-x | build/package-backend.sh | 20 | ||||
-rwxr-xr-x | build/package-gateway.sh | 24 |
10 files changed, 229 insertions, 91 deletions
diff --git a/build/create-rpms.sh b/build/create-rpms.sh index d0ad909b..de22d4db 100755 --- a/build/create-rpms.sh +++ b/build/create-rpms.sh @@ -2,18 +2,18 @@ #------------------------------------------------------------------ # Copyright (c) 2006-2011 Gluster, Inc. <http://www.gluster.com> -# This file is part of GlusterFS. -# -# Gluster Management Gateway is free software; you can redistribute -# it and/or modify it under the terms of the GNU General Public -# License as published by the Free Software Foundation; either +# This file is part of Gluster Management Gateway. +# +# Gluster Management Gateway is free software; you can redistribute +# it and/or modify it under the terms of the GNU General Public +# License as published by the Free Software Foundation; either # version 3 of the License, or (at your option) any later version. -# -# GlusterFS is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# +# +# Gluster Management Gateway is distributed in the hope that it +# will be useful, but WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# # You should have received a copy of the GNU General Public License # along with this program. If not, see # <http://www.gnu.org/licenses/>. diff --git a/build/glustermg.spec b/build/glustermg.spec index a04b28b0..020a135a 100644 --- a/build/glustermg.spec +++ b/build/glustermg.spec @@ -5,7 +5,7 @@ %define current_arch x86 %endif -Summary: %{product_family} web IU component +Summary: %{product_family} Management Gateway Name: glustermg Version: %{release_version} Release: 1%{?extra_release} @@ -17,7 +17,7 @@ Requires: tomcat5 >= 5.5.23 Requires: java-1.6.0-openjdk >= 1.6.0.0 Requires: wget %description -%{product_family} web UI component for GlusterFS and Gluster appliances +%{product_family} Management Gateway %package backend Summary: %{product_family} server side backend tools diff --git a/build/gmc-buckminster.commands b/build/gmc-buckminster.commands index 0cd8eee7..eedde1d8 100755 --- a/build/gmc-buckminster.commands +++ b/build/gmc-buckminster.commands @@ -1,22 +1,23 @@ #------------------------------------------------------------------ # Copyright (c) 2006-2011 Gluster, Inc. <http://www.gluster.com> -# This file is part of GlusterFS. -# -# Gluster Management Console is free software; you can redistribute -# it and/or modify it under the terms of the GNU General Public -# License as published by the Free Software Foundation; either +# This file is part of Gluster Management Console. +# +# Gluster Management Console is free software; you can redistribute +# it and/or modify it under the terms of the GNU General Public +# License as published by the Free Software Foundation; either # version 3 of the License, or (at your option) any later version. -# -# GlusterFS is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# +# +# Gluster Management Console is distributed in the hope that it +# will be useful, but WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# # You should have received a copy of the GNU General Public License # along with this program. If not, see # <http://www.gnu.org/licenses/>. #------------------------------------------------------------------ + # Buckminster commands to build Gluster Management Console importtarget --active gmc-target/org.gluster.storage.management.console.target/gmc.target diff --git a/build/gmc-build.sh b/build/gmc-build.sh index f30fa783..6d197f36 100755 --- a/build/gmc-build.sh +++ b/build/gmc-build.sh @@ -2,18 +2,18 @@ #------------------------------------------------------------------ # Copyright (c) 2006-2011 Gluster, Inc. <http://www.gluster.com> -# This file is part of GlusterFS. -# -# Gluster Management Console is free software; you can redistribute -# it and/or modify it under the terms of the GNU General Public -# License as published by the Free Software Foundation; either +# This file is part of Gluster Management Console. +# +# Gluster Management Console is free software; you can redistribute +# it and/or modify it under the terms of the GNU General Public +# License as published by the Free Software Foundation; either # version 3 of the License, or (at your option) any later version. -# -# GlusterFS is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# +# +# Gluster Management Console is distributed in the hope that it +# will be useful, but WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# # You should have received a copy of the GNU General Public License # along with this program. If not, see # <http://www.gnu.org/licenses/>. diff --git a/build/gmg-backend-install.sh b/build/gmg-backend-install.sh new file mode 100755 index 00000000..13531cda --- /dev/null +++ b/build/gmg-backend-install.sh @@ -0,0 +1,131 @@ +#!/bin/bash + +#------------------------------------------------------------------ +# Copyright (c) 2006-2011 Gluster, Inc. <http://www.gluster.com> +# This file is part of Gluster Management Gateway. +# +# Gluster Management Gateway is free software; you can redistribute +# it and/or modify it under the terms of the GNU General Public +# License as published by the Free Software Foundation; either +# version 3 of the License, or (at your option) any later version. +# +# Gluster Management Gateway is distributed in the hope that it +# will be useful, but WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see +# <http://www.gnu.org/licenses/>. +#------------------------------------------------------------------ + +# Variables +USAGE_ERR=1 +FUSE_ERR=2 +TAR_ERR=3 +GMGBE_ROOT_DIR="/opt/glustermg" + +function quit() +{ + echo ${1} + echo + exit ${2} +} + +function pre() +{ + modprobe -q fuse + if ! lsmod | grep -qw fuse; then + quit "FATAL: fuse kernel module is not found." ${FUSE_ERR} + fi +} + +function check_tar_gz() +{ + file $GMGBE_ARCHIVE_PATH | grep "gzip" > /dev/null; + if [ $? != 0 ] ; then + quit "The given filename is not a gunzipped tarball. The file name must be of the form glustermg-backend-version.tar.gz" ${TAR_ERR} + fi +} + +function get_gmg_version() +{ + # Format is /path/to/glustermg-backend-version.tar.gz + # Remove prefix + PART1=${GMG_ARCHIVE_PATH#*glustermg-backend-} + # Remove suffix + GMG_VERSION=${PART1%.tar.gz} + + GMGBE_DIR="${GMGBE_ROOT_DIR}/${GMG_VERSION}/backend"; +} + +function make_dirs() +{ + mkdir -p $GMGBE_DIR /var/lib/rrd +} + +function extract_archive() +{ + tar xvfz ${GMGBE_ARCHIVE_PATH} + + # The tar contains files in path glustermg-backend-version/gmg-scripts/*.py + SRC_DIR=glustermg-backend-${GMG_VERSION} + mv ${SRC_DIR}/gmg-scripts/* ${GMGBE_DIR} + rm -rf ${SRC_DIR} +} + +function create_links() +{ + ln -fs ${GMGBE_DIR}/multicast-discoverd.py /usr/sbin/multicast-discoverd + ln -fs ${GMGBE_DIR}/gluster_cifs_volume_startup.py /usr/sbin/gluster_cifs_volume_startup + ln -fs ${GMGBE_DIR}/multicast-discoverd.init.d /etc/init.d/multicast-discoverd + ln -fs ${GMGBE_DIR}/gluster-volume-settings.init.d /etc/init.d/gluster-volume-settings +} + +function post() +{ + if [ -f /etc/sudoers ]; then + chmod 644 /etc/sudoers + sed -i '/^Defaults.*requiretty/d' /etc/sudoers + chmod 0440 /etc/sudoers + fi + + if ! grep -q rrd_cpu.pl /etc/crontab; then + echo '*/5 * * * * root /opt/glustermg/%{GMG_VERSION}/backend/rrd_cpu.pl' >> /etc/crontab + fi + if ! grep -q rrd_mem.pl /etc/crontab; then + echo '*/5 * * * * root /opt/glustermg/%{GMG_VERSION}/backend/rrd_mem.pl' >> /etc/crontab + fi + if ! grep -q rrd_net.pl /etc/crontab; then + echo '*/5 * * * * root /opt/glustermg/%{GMG_VERSION}/backend/rrd_net.pl' >> /etc/crontab + fi + /sbin/chkconfig --add multicast-discoverd + /sbin/chkconfig --level 345 multicast-discoverd on + if /etc/init.d/multicast-discoverd status >/dev/null; then + /etc/init.d/multicast-discoverd restart + else + /etc/init.d/multicast-discoverd start + fi + /etc/init.d/crond reload + /sbin/chkconfig smb on + /sbin/chkconfig --add gluster-volume-settings +} + +#----------------------------------- +# Main Action Body +#----------------------------------- + +if [ $# -ne 1 ]; then + quit "Usage: $0 <path to glustermg-backend-version.tar.gz>" ${USAGE_ERR} +fi + +GMGBE_ARCHIVE_PATH=${1} + +pre +check_tar_gz +get_gmg_version + +make_dirs +extract_archive +create_links + diff --git a/build/gmg-buckminster.commands b/build/gmg-buckminster.commands index c8c4bcfa..d617bf62 100755 --- a/build/gmg-buckminster.commands +++ b/build/gmg-buckminster.commands @@ -1,17 +1,17 @@ #------------------------------------------------------------------ # Copyright (c) 2006-2011 Gluster, Inc. <http://www.gluster.com> -# This file is part of GlusterFS. -# -# Gluster Management Gateway is free software; you can redistribute -# it and/or modify it under the terms of the GNU General Public -# License as published by the Free Software Foundation; either +# This file is part of Gluster Management Gateway. +# +# Gluster Management Gateway is free software; you can redistribute +# it and/or modify it under the terms of the GNU General Public +# License as published by the Free Software Foundation; either # version 3 of the License, or (at your option) any later version. -# -# GlusterFS is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# +# +# Gluster Management Gateway is distributed in the hope that it +# will be useful, but WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# # You should have received a copy of the GNU General Public License # along with this program. If not, see # <http://www.gnu.org/licenses/>. diff --git a/build/gmg-install.sh b/build/gmg-install.sh index b908a04a..76026260 100755 --- a/build/gmg-install.sh +++ b/build/gmg-install.sh @@ -2,18 +2,18 @@ #------------------------------------------------------------------ # Copyright (c) 2006-2011 Gluster, Inc. <http://www.gluster.com> -# This file is part of GlusterFS. -# -# Gluster Management Gateway is free software; you can redistribute -# it and/or modify it under the terms of the GNU General Public -# License as published by the Free Software Foundation; either +# This file is part of Gluster Management Gateway. +# +# Gluster Management Gateway is free software; you can redistribute +# it and/or modify it under the terms of the GNU General Public +# License as published by the Free Software Foundation; either # version 3 of the License, or (at your option) any later version. -# -# GlusterFS is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# +# +# Gluster Management Gateway is distributed in the hope that it +# will be useful, but WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# # You should have received a copy of the GNU General Public License # along with this program. If not, see # <http://www.gnu.org/licenses/>. @@ -48,10 +48,13 @@ function post_install() function create_links() { + if [ -f ${WEBAPPS_DIR}/glustermg ]; then + rm -f ${WEBAPPS_DIR}/glustermg + fi ln -fs ${GMG_HOME_DIR}/glustermg ${WEBAPPS_DIR} GMG_SCRIPTS_DIR="${GMG_HOME_DIR}/glustermg/scripts" - ln -sf ${GMG_SCRIPTS_DIR}/grun.py /usr/sbin/grun.py + ln -sf ${GMG_SCRIPTS_DIR}/grun.py /usr/bin/grun.py ln -sf ${GMG_SCRIPTS_DIR}/add_user_cifs_all.py /usr/sbin/add_user_cifs_all.py ln -sf ${GMG_SCRIPTS_DIR}/delete_user_cifs_all.py /usr/sbin/delete_user_cifs_all.py ln -sf ${GMG_SCRIPTS_DIR}/setup_cifs_config_all.py /usr/sbin/setup_cifs_config_all.py @@ -174,8 +177,7 @@ function install_gmg() #----------------------------------- if [ "x$1" == "x" ] || [ "x$1$2" == "x$1" ] || [ $# -gt 2 ]; then - echo "Usage: $0 <path to glustermg-version.war.tar.gz> <path to tomcat directory>"; - exit 1; + quit "Usage: $0 <path to glustermg-version.war.tar.gz> <path to tomcat directory>" ${USAGE_ERR} fi GMG_ARCHIVE_PATH="$1"; diff --git a/build/junit-buckminster.commands b/build/junit-buckminster.commands index b903876d..7a0d260b 100755 --- a/build/junit-buckminster.commands +++ b/build/junit-buckminster.commands @@ -1,17 +1,17 @@ #------------------------------------------------------------------ # Copyright (c) 2006-2011 Gluster, Inc. <http://www.gluster.com> -# This file is part of GlusterFS. -# -# Gluster Management Console is free software; you can redistribute -# it and/or modify it under the terms of the GNU General Public -# License as published by the Free Software Foundation; either +# This file is part of Gluster Management Console. +# +# Gluster Management Console is free software; you can redistribute +# it and/or modify it under the terms of the GNU General Public +# License as published by the Free Software Foundation; either # version 3 of the License, or (at your option) any later version. -# -# GlusterFS is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# +# +# Gluster Management Console is distributed in the hope that it +# will be useful, but WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# # You should have received a copy of the GNU General Public License # along with this program. If not, see # <http://www.gnu.org/licenses/>. diff --git a/build/package-backend.sh b/build/package-backend.sh index 9cd6703f..e20471d5 100755 --- a/build/package-backend.sh +++ b/build/package-backend.sh @@ -2,17 +2,17 @@ #------------------------------------------------------------------ # Copyright (c) 2006-2011 Gluster, Inc. <http://www.gluster.com> -# This file is part of GlusterFS. +# This file is part of Gluster Management Gateway. # # Gluster Management Gateway is free software; you can redistribute # it and/or modify it under the terms of the GNU General Public # License as published by the Free Software Foundation; either # version 3 of the License, or (at your option) any later version. # -# GlusterFS is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. +# Gluster Management Gateway is distributed in the hope that it +# will be useful, but WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see @@ -22,6 +22,8 @@ ROOT_DIR=glustermg-backend-${VERSION} DIR_NAME=${ROOT_DIR}/gmg-scripts TAR_NAME=${ROOT_DIR}.tar +INSTALL_SCRIPT_NAME=gmg-backend-install.sh +INSTALLER_TAR_NAME=gmg-backend-installer-${VERSION}.war.tar prepare-script-dir() { @@ -52,10 +54,12 @@ prepare-script-dir get-scripts /bin/rm -rf ${TAR_NAME} ${TAR_NAME}.gz -tar cvf ${TAR_NAME} ${ROOT_DIR} -gzip ${TAR_NAME} +tar cvfz ${TAR_NAME}.gz ${ROOT_DIR} +cp build/${INSTALL_SCRIPT_NAME} . +tar cvfz ${INSTALLER_TAR_NAME}.gz ${TAR_NAME}.gz ${INSTALL_SCRIPT_NAME} + if [ ! -z "${DIST_DIR}" ]; then - mv ${TAR_NAME}.gz ${DIST_DIR} + mv ${INSTALLER_TAR_NAME}.gz ${DIST_DIR} fi /bin/rm -rf ${ROOT_DIR} diff --git a/build/package-gateway.sh b/build/package-gateway.sh index c286e427..53ebaba2 100755 --- a/build/package-gateway.sh +++ b/build/package-gateway.sh @@ -2,18 +2,18 @@ #------------------------------------------------------------------ # Copyright (c) 2006-2011 Gluster, Inc. <http://www.gluster.com> -# This file is part of GlusterFS. -# -# Gluster Management Gateway is free software; you can redistribute -# it and/or modify it under the terms of the GNU General Public -# License as published by the Free Software Foundation; either +# This file is part of Gluster Management Gateway. +# +# Gluster Management Gateway is free software; you can redistribute +# it and/or modify it under the terms of the GNU General Public +# License as published by the Free Software Foundation; either # version 3 of the License, or (at your option) any later version. -# -# GlusterFS is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# +# +# Gluster Management Gateway is distributed in the hope that it +# will be useful, but WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# # You should have received a copy of the GNU General Public License # along with this program. If not, see # <http://www.gnu.org/licenses/>. @@ -109,7 +109,7 @@ if [ $# -eq 2 ]; then fi SERVER_DIST_DIR=${DIST_DIR:-${WORKSPACE}/buckminster.output} -echo "Packaging GlusterFS Management Gateway..." +echo "Packaging Gluster Management Gateway..." prepare-dist-dir get-scripts |