Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100755 156 lines (126 sloc) 4.453 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
f7b03a5 @timf install output cleanup/normalization
timf authored
118 echo ""
f4963f9 @labisso Cleaned up install script output.
labisso authored
119 echo "-----------------------------------------------------------------"
120 echo " Configuring installed services"
121 echo "-----------------------------------------------------------------"
122
5b452b8 @labisso Installer bugfixes and enhancements
labisso authored
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
134 echo " $CONFIG_SCRIPT"
8cc7d25 @labisso nimbus-configure improvements.
labisso authored
135 echo "You can also run the script with debugging output:"
136 echo " $CONFIG_SCRIPT --debug"
5b452b8 @labisso Installer bugfixes and enhancements
labisso authored
137 exit 1
138 fi
139
e40196f @timf Got things working with cumulus.conf instead of @TOKEN@ post-deploy m…
timf authored
140
071009d No longer downloads twisted. This was fixed by capitalizing the T (p…
BuzzTroll authored
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
142 # need PIPESTATUS because tee is not the exit code of interest
9993e54 further changes to integrate lan torrent
BuzzTroll authored
143 rc=$PIPESTATUS
144 if [ $rc -ne 0 ]; then
145 exit $rc
146 fi
147
1c4036a setting up env right before running lantorrent install
BuzzTroll authored
148 export NIMBUS_HOME
3c63e29 recreating work after the 'incident'
BuzzTroll authored
149 $NIMBUS_SRC/lantorrent/install.sh $NIMBUS_HOME/lantorrent | tee -a $NIMBUS_HOME/install.log
9993e54 further changes to integrate lan torrent
BuzzTroll authored
150 rc=$PIPESTATUS
151 if [ $rc -ne 0 ]; then
152 echo "lantorrent install failed"
153 exit $rc
154 fi
155 exit 0
Something went wrong with that request. Please try again.