Skip to content
Newer
Older
100755 144 lines (115 sloc) 4.11 KB
e633c0d @timf Bug 7009 - All scripts should use shebang /bin/bash
timf authored Apr 30, 2010
1 #!/bin/bash
5b452b8 @labisso Installer bugfixes and enhancements
labisso authored Feb 4, 2010
2
3 FORCE_FRESH_INSTALL="yes"
4
07cd774 patched install program to do relative and abosulte paths
BuzzTroll authored Jul 9, 2010
5 START_DIR=`pwd`
6
f7b03a5 @timf install output cleanup/normalization
timf authored Jul 1, 2010
7 NIMBUS_SRC_REL="`dirname $0`"
5b452b8 @labisso Installer bugfixes and enhancements
labisso authored Feb 4, 2010
8 NIMBUS_SRC=`cd $NIMBUS_SRC_REL; pwd`
9
54cddac @labisso /bin/sh compatiblity
labisso authored Apr 29, 2010
10 if [ "X$1" = "X" ]; then
906cafe @labisso Fixes to setup and nimbusctl scripts.
labisso authored Mar 9, 2010
11 echo ""
12 echo "Usage: $0 destination_dir"
43b8a93 @labisso Echo doesn't also understand newlines.
labisso authored Apr 15, 2010
13 echo " You must specify the destination directory."
14 echo ""
5b452b8 @labisso Installer bugfixes and enhancements
labisso authored Feb 4, 2010
15 exit 1
16 fi
17
07cd774 patched install program to do relative and abosulte paths
BuzzTroll authored Jul 9, 2010
18 NIMBUS_REL_BASE_HOME="`dirname $1`"
19 NIMBUS_BASE_HOME=`cd $NIMBUS_REL_BASE_HOME; pwd`
0aab144 catch non existant parent director for the installer
BuzzTroll authored Jul 9, 2010
20
21 if [ ! -e $NIMBUS_REL_BASE_HOME ]; then
22 echo "The parent directory for the installation path $1 must exist"
23 exit 1
24 fi
25
07cd774 patched install program to do relative and abosulte paths
BuzzTroll authored Jul 9, 2010
26 NIMBUS_INST_DIR=`basename $1`
27 NIMBUS_HOME="$NIMBUS_BASE_HOME/$NIMBUS_INST_DIR"
28 echo "NIMBUS_HOME $NIMBUS_HOME"
29
33ae148 @timf use an environment variable instead to fix Bug 7041
timf authored Jun 14, 2010
30 if [ "X$NIMBUS_ALLOW_ROOT_INSTALL" != "Xyes" ] && [ $EUID -eq 0 ]; then
8cb5a4f @labisso Added basic root check to install script.
labisso authored Jun 14, 2010
31 echo ""
33ae148 @timf use an environment variable instead to fix Bug 7041
timf authored Jun 15, 2010
32 echo "It is not recommended to install or run Nimbus as root."
33 echo "If you insist, set the NIMBUS_ALLOW_ROOT_INSTALL environment variable to \"yes\""
8cb5a4f @labisso Added basic root check to install script.
labisso authored Jun 14, 2010
34 echo ""
35 exit 1
36 fi
37
5b452b8 @labisso Installer bugfixes and enhancements
labisso authored Feb 4, 2010
38 if [ -d $NIMBUS_HOME ] && [ "$(ls -A $NIMBUS_HOME)" ]; then
54cddac @labisso /bin/sh compatiblity
labisso authored Apr 29, 2010
39 if [ $FORCE_FRESH_INSTALL = "yes" ]; then
5b452b8 @labisso Installer bugfixes and enhancements
labisso authored Feb 4, 2010
40 echo ""
41 echo "The destination directory '$NIMBUS_HOME' exists and is not empty."
42 echo "It is not recommended to reinstall Nimbus into an existing install."
43 echo ""
44 echo "If you are making changes to the services, you can build and install those directly:"
906cafe @labisso Fixes to setup and nimbusctl scripts.
labisso authored Mar 9, 2010
45 echo " export GLOBUS_LOCATION=$NIMBUS_HOME/services"
46 echo " scripts/all-build-and-install.sh"
5b452b8 @labisso Installer bugfixes and enhancements
labisso authored Feb 4, 2010
47 echo ""
48 echo "If you know what you are doing and want to reinstall, edit this script:"
906cafe @labisso Fixes to setup and nimbusctl scripts.
labisso authored Mar 9, 2010
49 echo " $0"
5b452b8 @labisso Installer bugfixes and enhancements
labisso authored Feb 4, 2010
50 echo "and change FORCE_FRESH_INSTALL to \"no\""
51 echo ""
52
53 exit 1
54 fi
55 fi
56
c7b45ca nice stubs for the 'web' library
BuzzTroll authored Jun 22, 2010
57
58 if [ ! -d $NIMBUS_HOME ]; then
59 mkdir $NIMBUS_HOME
60 fi
61
c25af42 @timf added chmod to install.log since the initial admin secret is printed;…
timf authored Jun 27, 2010
62 # If the dir exists but is not writable, this will also trip that situation early/gracefully.
63 touch $NIMBUS_HOME/install.log
64 if [ $? -ne 0 ]; then
65 echo "ERROR: cannot write install log file: $NIMBUS_HOME/install.log"
66 exit 1
67 fi
68
69 # The install log contains the initial cumulus admin secrets
70 chmod 600 $NIMBUS_HOME/install.log
71 if [ $? -ne 0 ]; then
72 echo "ERROR: cannot chmod install log file: $NIMBUS_HOME/install.log"
73 exit 1
74 fi
75
079efb0 @labisso Allow setting PYTHON env to use alternate version
labisso authored Jun 29, 2010
76 if [ "X$PYTHON" = "X" ]; then
77 PYTHON_EXE=`which python`
78 else
79 PYTHON_EXE="$PYTHON"
80 fi
722a0f4 mo code, mo problems.
BuzzTroll authored Jun 25, 2010
81 # returns 0 if Python 2.5+
82 $PYTHON_EXE -c "import sys; sys.exit(sys.version_info < (2,5))"
1470f78 @timf check for Python 2.4 before anything happens
timf authored Apr 30, 2010
83 if [ $? -ne 0 ]; then
ee48980 @timf Note that Python 2.5 is only for the service node (though this could …
timf authored Jun 29, 2010
84 echo "ERROR: The central Nimbus node must have Python version 2.5 or later (VMM nodes can have 2.4+)."
1470f78 @timf check for Python 2.4 before anything happens
timf authored Apr 30, 2010
85 exit 1
86 fi
87
f7b03a5 @timf install output cleanup/normalization
timf authored Jul 1, 2010
88 echo ""
89 echo "-----------------------------------------------------------------" | tee -a $NIMBUS_HOME/install.log
90 echo "Making the Python virtual environment" | tee -a $NIMBUS_HOME/install.log
91 echo "-----------------------------------------------------------------" | tee -a $NIMBUS_HOME/install.log
92 echo ""
c25af42 @timf added chmod to install.log since the initial admin secret is printed;…
timf authored Jun 28, 2010
93
237381b ready to push
BuzzTroll authored Jun 26, 2010
94 pyve_path=$NIMBUS_HOME/ve
c25af42 @timf added chmod to install.log since the initial admin secret is printed;…
timf authored Jun 28, 2010
95 echo "Installing from $NIMBUS_SRC"
96
8ed3352 updating the doc to reflect changes that will be in 2.5
BuzzTroll authored Jul 2, 2010
97 cp $NIMBUS_SRC/cumulus/*.egg .
c25af42 @timf added chmod to install.log since the initial admin secret is printed;…
timf authored Jun 28, 2010
98 $PYTHON_EXE $NIMBUS_SRC/cumulus/virtualenv.py -p $PYTHON_EXE $pyve_path | tee -a $NIMBUS_HOME/install.log
99 if [ $PIPESTATUS -ne 0 ]; then
722a0f4 mo code, mo problems.
BuzzTroll authored Jun 25, 2010
100 echo "ERROR: python virtualenv installation failed."
101 exit 1
102 fi
103
071009d No longer downloads twisted. This was fixed by capitalizing the T (pe…
BuzzTroll authored Jun 30, 2010
104 $NIMBUS_SRC/libexec/create-nimbus-home $NIMBUS_HOME 2>&1 | tee -a $NIMBUS_HOME/install.log
1470f78 @timf check for Python 2.4 before anything happens
timf authored Apr 30, 2010
105
e03a295 @timf exit checks with tee need PIPESTATUS
timf authored Jun 27, 2010
106 # need PIPESTATUS because tee is not the exit code this needs to check
107 if [ $PIPESTATUS -ne 0 ]; then
f4963f9 @labisso Cleaned up install script output.
labisso authored Mar 23, 2010
108 echo ""
5b452b8 @labisso Installer bugfixes and enhancements
labisso authored Feb 4, 2010
109 exit 1
110 fi
111
e40196f @timf Got things working with cumulus.conf instead of @TOKEN@ post-deploy m…
timf authored Jun 21, 2010
112 CUMULUS_ENV="$NIMBUS_HOME/cumulus/env.sh"
113 if [ ! -f $CUMULUS_ENV ]; then
114 echo "Expected file to be created: $CUMULUS_ENV"
115 exit 1
116 fi
117
f7b03a5 @timf install output cleanup/normalization
timf authored Jul 1, 2010
118 echo ""
f4963f9 @labisso Cleaned up install script output.
labisso authored Mar 23, 2010
119 echo "-----------------------------------------------------------------"
120 echo " Configuring installed services"
121 echo "-----------------------------------------------------------------"
122
5b452b8 @labisso Installer bugfixes and enhancements
labisso authored Feb 4, 2010
123 CONFIG_SCRIPT="$NIMBUS_HOME/bin/nimbus-configure"
124
125 if [ ! -f $CONFIG_SCRIPT ]; then
126 echo "Configuration script could not be found: $CONFIG_SCRIPT"
127 exit 1
128 fi
129
130 $CONFIG_SCRIPT
131
132 if [ $? -ne 0 ]; then
133 echo "Nimbus configuration script failed! You may try running it manually:"
906cafe @labisso Fixes to setup and nimbusctl scripts.
labisso authored Mar 9, 2010
134 echo " $CONFIG_SCRIPT"
8cc7d25 @labisso nimbus-configure improvements.
labisso authored Apr 12, 2010
135 echo "You can also run the script with debugging output:"
136 echo " $CONFIG_SCRIPT --debug"
5b452b8 @labisso Installer bugfixes and enhancements
labisso authored Feb 4, 2010
137 exit 1
138 fi
139
e40196f @timf Got things working with cumulus.conf instead of @TOKEN@ post-deploy m…
timf authored Jun 22, 2010
140
071009d No longer downloads twisted. This was fixed by capitalizing the T (pe…
BuzzTroll authored Jun 30, 2010
141 $NIMBUS_SRC/libexec/install-real.sh "${@}" 2>&1 | tee -a $NIMBUS_HOME/install.log
e03a295 @timf exit checks with tee need PIPESTATUS
timf authored Jun 28, 2010
142 # need PIPESTATUS because tee is not the exit code of interest
143 exit $PIPESTATUS
Something went wrong with that request. Please try again.