Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100755 245 lines (205 sloc) 7.755 kB
e633c0d @timf Bug 7009 - All scripts should use shebang /bin/bash
timf authored
1 #!/bin/bash
5b452b8 @labisso Installer bugfixes and enhancements
labisso authored
2
3 FORCE_FRESH_INSTALL="yes"
4
07cd774 patched install program to do relative and abosulte paths
BuzzTroll authored
5 START_DIR=`pwd`
6
f7b03a5 @timf install output cleanup/normalization
timf authored
7 NIMBUS_SRC_REL="`dirname $0`"
5b452b8 @labisso Installer bugfixes and enhancements
labisso authored
8 NIMBUS_SRC=`cd $NIMBUS_SRC_REL; pwd`
9
54cddac @labisso /bin/sh compatiblity
labisso authored
10 if [ "X$1" = "X" ]; then
906cafe @labisso Fixes to setup and nimbusctl scripts.
labisso authored
11 echo ""
12 echo "Usage: $0 destination_dir"
43b8a93 @labisso Echo doesn't also understand newlines.
labisso authored
13 echo " You must specify the destination directory."
14 echo ""
5b452b8 @labisso Installer bugfixes and enhancements
labisso authored
15 exit 1
16 fi
17
07cd774 patched install program to do relative and abosulte paths
BuzzTroll authored
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
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
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
30 if [ "X$NIMBUS_ALLOW_ROOT_INSTALL" != "Xyes" ] && [ $EUID -eq 0 ]; then
8cb5a4f @labisso Added basic root check to install script.
labisso authored
31 echo ""
33ae148 @timf use an environment variable instead to fix Bug 7041
timf authored
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
34 echo ""
35 exit 1
36 fi
37
5b452b8 @labisso Installer bugfixes and enhancements
labisso authored
38 if [ -d $NIMBUS_HOME ] && [ "$(ls -A $NIMBUS_HOME)" ]; then
54cddac @labisso /bin/sh compatiblity
labisso authored
39 if [ $FORCE_FRESH_INSTALL = "yes" ]; then
5b452b8 @labisso Installer bugfixes and enhancements
labisso authored
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
45 echo " export GLOBUS_LOCATION=$NIMBUS_HOME/services"
46 echo " scripts/all-build-and-install.sh"
5b452b8 @labisso Installer bugfixes and enhancements
labisso authored
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
49 echo " $0"
5b452b8 @labisso Installer bugfixes and enhancements
labisso authored
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
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
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
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
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
83 if [ $? -ne 0 ]; then
ee48980 @timf Note that Python 2.5 is only for the service node (though this could …
timf authored
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
85 exit 1
86 fi
87
f7b03a5 @timf install output cleanup/normalization
timf authored
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
93
237381b ready to push
BuzzTroll authored
94 pyve_path=$NIMBUS_HOME/ve
c25af42 @timf added chmod to install.log since the initial admin secret is printed;…
timf authored
95 echo "Installing from $NIMBUS_SRC"
96
8ed3352 updating the doc to reflect changes that will be in 2.5
BuzzTroll authored
97 cp $NIMBUS_SRC/cumulus/*.egg .
c25af42 @timf added chmod to install.log since the initial admin secret is printed;…
timf authored
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
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 (p…
BuzzTroll authored
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
105
e03a295 @timf exit checks with tee need PIPESTATUS
timf authored
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
108 echo ""
5b452b8 @labisso Installer bugfixes and enhancements
labisso authored
109 exit 1
110 fi
111
e40196f @timf Got things working with cumulus.conf instead of @TOKEN@ post-deploy m…
timf authored
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
43149cb @timf Initial install-from support, missing cumulus import
timf authored
118 export NIMBUS_HOME
119 $NIMBUS_SRC/lantorrent/install.sh $NIMBUS_HOME/lantorrent | tee -a $NIMBUS_HOME/install.log
120 rc=$PIPESTATUS
121 if [ $rc -ne 0 ]; then
122 echo "lantorrent install failed"
123 exit $rc
124 fi
125
126 echo ""
f4963f9 @labisso Cleaned up install script output.
labisso authored
127 echo "-----------------------------------------------------------------"
128 echo " Configuring installed services"
129 echo "-----------------------------------------------------------------"
130
5b452b8 @labisso Installer bugfixes and enhancements
labisso authored
131 CONFIG_SCRIPT="$NIMBUS_HOME/bin/nimbus-configure"
132
133 if [ ! -f $CONFIG_SCRIPT ]; then
134 echo "Configuration script could not be found: $CONFIG_SCRIPT"
135 exit 1
136 fi
137
43149cb @timf Initial install-from support, missing cumulus import
timf authored
138 vmm_cmd="Programmer. Error."
139 EXTRA_CONFIG_SCRIPT_ARGS=""
140 if [ "X" != "X$PREVIOUS_NIMBUS_HOME_VALIDATED" ]; then
141 echo ""
142 echo "Beginning the configuration with values from the old Nimbus installation: $PREVIOUS_NIMBUS_HOME_VALIDATED"
143 echo ""
144
145 oldnimbusconf=$PREVIOUS_NIMBUS_HOME_VALIDATED/nimbus-setup.conf
146 if [ ! -f $oldnimbusconf ]; then
147 echo "The old Nimbus installation does not have a configuration file, expecting to find: $oldnimbusconf"
148 exit 1
149 fi
150
151 cp $oldnimbusconf $NIMBUS_HOME/nimbus-setup.conf
152 if [ $? -ne 0 ]; then
153 echo "Could not copy the old configuration file: cp $oldnimbusconf $NIMBUS_HOME/nimbus-setup.conf"
154 exit 1
155 fi
156
157 EXTRA_CONFIG_SCRIPT_ARGS="--conf $NIMBUS_HOME/nimbus-setup.conf"
158
159 # We know that a fresh installation will have missing things specified in
160 # that conf file. Any relative path configuratoin in that previous conf
161 # file will be copied over here. Any absolute path will be noted but not
162 # touched.
163
164 $CONFIG_SCRIPT $EXTRA_CONFIG_SCRIPT_ARGS --import-prev
165 if [ $? -ne 0 ]; then
166 echo ""
167 echo "Could not import something specified in the old configuration file: $oldnimbusconf"
168 exit 1
169 fi
170
4ec97f2 @timf cumulus db import, need to test with old posixdata + unpropagation
timf authored
171 old_vmmdir="$PREVIOUS_NIMBUS_HOME_VALIDATED/services/etc/nimbus/workspace-service/vmm-pools"
43149cb @timf Initial install-from support, missing cumulus import
timf authored
172 vmm_cmd="$CONFIG_SCRIPT $EXTRA_CONFIG_SCRIPT_ARGS --import-vmms $old_vmmdir"
173 fi
5b452b8 @labisso Installer bugfixes and enhancements
labisso authored
174
43149cb @timf Initial install-from support, missing cumulus import
timf authored
175 $CONFIG_SCRIPT $EXTRA_CONFIG_SCRIPT_ARGS
5b452b8 @labisso Installer bugfixes and enhancements
labisso authored
176 if [ $? -ne 0 ]; then
177 echo "Nimbus configuration script failed! You may try running it manually:"
906cafe @labisso Fixes to setup and nimbusctl scripts.
labisso authored
178 echo " $CONFIG_SCRIPT"
8cc7d25 @labisso nimbus-configure improvements.
labisso authored
179 echo "You can also run the script with debugging output:"
180 echo " $CONFIG_SCRIPT --debug"
5b452b8 @labisso Installer bugfixes and enhancements
labisso authored
181 exit 1
182 fi
183
43149cb @timf Initial install-from support, missing cumulus import
timf authored
184 $NIMBUS_SRC/libexec/configure-cumulus.sh "${@}" 2>&1 | tee -a $NIMBUS_HOME/install.log
e03a295 @timf exit checks with tee need PIPESTATUS
timf authored
185 # need PIPESTATUS because tee is not the exit code of interest
0b8aa41 merged virga1 and master
BuzzTroll authored
186 rc=$PIPESTATUS
187 if [ $rc -ne 0 ]; then
188 exit $rc
189 fi
190
43149cb @timf Initial install-from support, missing cumulus import
timf authored
191 if [ "X" != "X$PREVIOUS_NIMBUS_HOME_VALIDATED" ]; then
4ec97f2 @timf cumulus db import, need to test with old posixdata + unpropagation
timf authored
192 echo ""
193 $CONFIG_SCRIPT $EXTRA_CONFIG_SCRIPT_ARGS --import-cumulusdb
194 if [ $? -ne 0 ]; then
195 echo ""
196 echo "Could not import Cumulus DB from the old configuration file: $oldnimbusconf"
197 exit 1
198 fi
43149cb @timf Initial install-from support, missing cumulus import
timf authored
199 fi
200
201 echo ""
202 GUIDEURL=`$NIMBUS_HOME/bin/nimbus-version --guide`
203 if [ $? -ne 0 ]; then
204 GUIDEURL="Development mode: no guide url"
205 fi
206
207 echo ""
208 echo "-----------------------------------------------------------------"
209 echo " Nimbus installation succeeded!"
210 echo "-----------------------------------------------------------------"
211 echo ""
212 echo "Additional configuration may be necessary, refer to this URL for information:"
213 echo ""
214 echo " $GUIDEURL"
215 echo ""
216 echo "You can start/stop Nimbus services with the nimbusctl command. e.g:"
217 echo ""
218 echo " $NIMBUS_HOME/bin/nimbusctl start"
219 echo ""
220
221 if [ "X" != "X$PREVIOUS_NIMBUS_HOME_VALIDATED" ]; then
222 old_etc_dir=$PREVIOUS_NIMBUS_HOME_VALIDATED/services/etc/nimbus
223 new_etc_dir=$NIMBUS_HOME/services/etc/nimbus
224 echo "-----------------------------------------------------------------"
4ec97f2 @timf cumulus db import, need to test with old posixdata + unpropagation
timf authored
225 echo " ** Upgrade work still needed **"
43149cb @timf Initial install-from support, missing cumulus import
timf authored
226 echo "-----------------------------------------------------------------"
227 echo ""
228 echo "While key settings have been transferred from your old install,"
229 echo "you still need to do a manual confirmation and transfer of"
230 echo "customizations."
231 echo ""
232 echo "Run the following command to look for customizations:"
233 echo ""
234 echo " diff -u -r $old_etc_dir $new_etc_dir"
235 echo ""
236 echo "After using nimbusctl to start the services, use the following"
237 echo "command to import VMM configurations. This can only be done "
238 echo "with a running service:"
239 echo ""
240 echo " $vmm_cmd"
241 echo ""
0b8aa41 merged virga1 and master
BuzzTroll authored
242 fi
43149cb @timf Initial install-from support, missing cumulus import
timf authored
243
0b8aa41 merged virga1 and master
BuzzTroll authored
244 exit 0
Something went wrong with that request. Please try again.