Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

executable file 144 lines (115 sloc) 4.206 kb
#!/bin/bash
FORCE_FRESH_INSTALL="yes"
START_DIR=`pwd`
NIMBUS_SRC_REL="`dirname $0`"
NIMBUS_SRC=`cd $NIMBUS_SRC_REL; pwd`
if [ "X$1" = "X" ]; then
echo ""
echo "Usage: $0 destination_dir"
echo " You must specify the destination directory."
echo ""
exit 1
fi
NIMBUS_REL_BASE_HOME="`dirname $1`"
NIMBUS_BASE_HOME=`cd $NIMBUS_REL_BASE_HOME; pwd`
if [ ! -e $NIMBUS_REL_BASE_HOME ]; then
echo "The parent directory for the installation path $1 must exist"
exit 1
fi
NIMBUS_INST_DIR=`basename $1`
NIMBUS_HOME="$NIMBUS_BASE_HOME/$NIMBUS_INST_DIR"
echo "NIMBUS_HOME $NIMBUS_HOME"
if [ "X$NIMBUS_ALLOW_ROOT_INSTALL" != "Xyes" ] && [ $EUID -eq 0 ]; then
echo ""
echo "It is not recommended to install or run Nimbus as root."
echo "If you insist, set the NIMBUS_ALLOW_ROOT_INSTALL environment variable to \"yes\""
echo ""
exit 1
fi
if [ -d $NIMBUS_HOME ] && [ "$(ls -A $NIMBUS_HOME)" ]; then
if [ $FORCE_FRESH_INSTALL = "yes" ]; then
echo ""
echo "The destination directory '$NIMBUS_HOME' exists and is not empty."
echo "It is not recommended to reinstall Nimbus into an existing install."
echo ""
echo "If you are making changes to the services, you can build and install those directly:"
echo " export GLOBUS_LOCATION=$NIMBUS_HOME/services"
echo " scripts/all-build-and-install.sh"
echo ""
echo "If you know what you are doing and want to reinstall, edit this script:"
echo " $0"
echo "and change FORCE_FRESH_INSTALL to \"no\""
echo ""
exit 1
fi
fi
if [ ! -d $NIMBUS_HOME ]; then
mkdir $NIMBUS_HOME
fi
# If the dir exists but is not writable, this will also trip that situation early/gracefully.
touch $NIMBUS_HOME/install.log
if [ $? -ne 0 ]; then
echo "ERROR: cannot write install log file: $NIMBUS_HOME/install.log"
exit 1
fi
# The install log contains the initial cumulus admin secrets
chmod 600 $NIMBUS_HOME/install.log
if [ $? -ne 0 ]; then
echo "ERROR: cannot chmod install log file: $NIMBUS_HOME/install.log"
exit 1
fi
if [ "X$PYTHON" = "X" ]; then
PYTHON_EXE=`which python`
else
PYTHON_EXE="$PYTHON"
fi
# returns 0 if Python 2.5+
$PYTHON_EXE -c "import sys; sys.exit(sys.version_info < (2,5))"
if [ $? -ne 0 ]; then
echo "ERROR: The central Nimbus node must have Python version 2.5 or later (VMM nodes can have 2.4+)."
exit 1
fi
echo ""
echo "-----------------------------------------------------------------" | tee -a $NIMBUS_HOME/install.log
echo "Making the Python virtual environment" | tee -a $NIMBUS_HOME/install.log
echo "-----------------------------------------------------------------" | tee -a $NIMBUS_HOME/install.log
echo ""
pyve_path=$NIMBUS_HOME/ve
echo "Installing from $NIMBUS_SRC"
cp $NIMBUS_SRC/cumulus/*.egg .
$PYTHON_EXE $NIMBUS_SRC/cumulus/virtualenv.py -p $PYTHON_EXE $pyve_path | tee -a $NIMBUS_HOME/install.log
if [ $PIPESTATUS -ne 0 ]; then
echo "ERROR: python virtualenv installation failed."
exit 1
fi
$NIMBUS_SRC/libexec/create-nimbus-home $NIMBUS_HOME 2>&1 | tee -a $NIMBUS_HOME/install.log
# need PIPESTATUS because tee is not the exit code this needs to check
if [ $PIPESTATUS -ne 0 ]; then
echo ""
exit 1
fi
CUMULUS_ENV="$NIMBUS_HOME/cumulus/env.sh"
if [ ! -f $CUMULUS_ENV ]; then
echo "Expected file to be created: $CUMULUS_ENV"
exit 1
fi
echo ""
echo "-----------------------------------------------------------------"
echo " Configuring installed services"
echo "-----------------------------------------------------------------"
CONFIG_SCRIPT="$NIMBUS_HOME/bin/nimbus-configure"
if [ ! -f $CONFIG_SCRIPT ]; then
echo "Configuration script could not be found: $CONFIG_SCRIPT"
exit 1
fi
$CONFIG_SCRIPT
if [ $? -ne 0 ]; then
echo "Nimbus configuration script failed! You may try running it manually:"
echo " $CONFIG_SCRIPT"
echo "You can also run the script with debugging output:"
echo " $CONFIG_SCRIPT --debug"
exit 1
fi
$NIMBUS_SRC/libexec/install-real.sh "${@}" 2>&1 | tee -a $NIMBUS_HOME/install.log
# need PIPESTATUS because tee is not the exit code of interest
exit $PIPESTATUS
Jump to Line
Something went wrong with that request. Please try again.