diff --git a/bin/create-nimbus-home.sh b/bin/create-nimbus-home.sh index c1a5c5d5..89454f93 100755 --- a/bin/create-nimbus-home.sh +++ b/bin/create-nimbus-home.sh @@ -95,10 +95,8 @@ echo "Building and installing Nimbus to service container.." GLOBUS_LOCATION=$CONTAINER_DIR export GLOBUS_LOCATION -#$NIMBUS_SRC/scripts/all-build-and-install.sh +$NIMBUS_SRC/scripts/all-build-and-install.sh if [ $? -ne 0 ]; then echo "Build and install FAILED!" exit 1 fi - -echo "OK, successfully deployed to $NIMBUS_HOME!" diff --git a/bin/install.sh b/bin/install.sh new file mode 100755 index 00000000..95e127b4 --- /dev/null +++ b/bin/install.sh @@ -0,0 +1,64 @@ +#!/bin/sh + +FORCE_FRESH_INSTALL="yes" + +NIMBUS_SRC_REL="`dirname $0`/.." +NIMBUS_SRC=`cd $NIMBUS_SRC_REL; pwd` + +if [ "X$1" == "X" ]; then + echo "\nUsage: $0 destination_dir" + echo "\tYou must specify the destination directory.\n" + exit 1 +fi + +NIMBUS_HOME=$1 + +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 "\texport GLOBUS_LOCATION=$NIMBUS_HOME/services" + echo "\tscripts/all-build-and-install.sh" + echo "" + echo "If you know what you are doing and want to reinstall, edit this script:" + echo "\t$0" + echo "and change FORCE_FRESH_INSTALL to \"no\"" + echo "" + + exit 1 + fi +fi + +$NIMBUS_SRC/bin/create-nimbus-home.sh $NIMBUS_HOME + +if [ $? -ne 0 ]; then + echo "Nimbus home creation failed!" + exit 1 +fi + +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 "\t$CONFIG_SCRIPT" + exit 1 +fi + +echo "" +echo "Nimbus installation succeeded!" +echo "However, additional configuration may be necessary." +echo "Refer to the Administrator Guide for details.\n" +echo "You can now start/stop Nimbus services with the nimbusctl command. e.g:" +echo "\t$NIMBUS_HOME/bin/nimbusctl start\n" + +exit 0 diff --git a/home/bin/setup.sh b/home/bin/nimbus-configure similarity index 52% rename from home/bin/setup.sh rename to home/bin/nimbus-configure index 69153748..399ab76c 100755 --- a/home/bin/setup.sh +++ b/home/bin/nimbus-configure @@ -1,7 +1,5 @@ #!/bin/bash -OWNER_IS_RUNNER_ASSUMPTION="yes" - PYTHON_EXE="/usr/bin/env python" NIMBUS_HOME_REL="`dirname $0`/.." @@ -27,20 +25,25 @@ export PYTHONPATH # ------------------------------------------------------------------------------ -if [ "X$OWNER_IS_RUNNER_ASSUMPTION" == "Xyes" ]; then - # The following script expands the tarballs in lib/ - $NIMBUS_WEBDIR/sbin/install-deps.sh $DEBUG - if [ $? -ne 0 ]; then - echo "" - echo "Dependencies are not set up properly, exiting." - exit 3 - fi - - $PYTHON_EXE $NIMBUS_HOME/sbin/setup.py --basedir $NIMBUS_HOME $SETUP_ARGS - if [ $? -ne 0 ]; then - echo "" - echo "Nimbus is not set up properly, exiting." - exit 2 - fi +# The following script expands the tarballs in lib/ +$NIMBUS_WEBDIR/sbin/install-deps.sh $DEBUG +if [ $? -ne 0 ]; then + echo "" + echo "Dependencies are not set up properly, exiting." + exit 3 +fi + +$PYTHON_EXE $NIMBUS_HOME/sbin/setup.py --basedir $NIMBUS_HOME $SETUP_ARGS +if [ $? -ne 0 ]; then + echo "" + echo "Nimbus is not set up properly, exiting." + exit 2 fi +#TODO this functionality should be moved into setup.py +$NIMBUS_WEBDIR/sbin/new-conf.sh +if [ $? -ne 0 ]; then + echo "" + echo "Nimbus web is not set up properly, exiting." + exit 2 +fi diff --git a/home/sbin/setup.py b/home/sbin/setup.py index 925b69e6..159bb199 100755 --- a/home/sbin/setup.py +++ b/home/sbin/setup.py @@ -10,7 +10,7 @@ from StringIO import StringIO import readline -from nimbusweb.setup import pathutil, javautil, checkssl, gtcontainer +from nimbusweb.setup import pathutil,javautil,checkssl,gtcontainer from nimbusweb.setup.setuperrors import * CONFIGSECTION = 'nimbussetup' @@ -267,6 +267,7 @@ def perform_setup(self): # some potentially interactive queries hostname = self.hostname() + #TODO this may require interaction checkssl.run(webdir, hostcert, hostkey, log, cadir=cadir, hostname=hostname) @@ -282,7 +283,7 @@ def perform_setup(self): with open(webconfpath, 'wb') as webconffile: webconf.write(webconffile) - + if not os.path.exists(gridmap): example_gridmap = self.resolve_path('var/gridmap.example') import shutil