4 |
|
# |
5 |
|
# Installation script for Crab |
6 |
|
# |
7 |
< |
# 02-Nov-2005 |
7 |
> |
# 09-March-2006 |
8 |
|
|
9 |
|
# Subdir structure: |
10 |
|
# top/ |
11 |
|
# Boss/... |
12 |
< |
# Crab/python |
13 |
< |
# Crab/script |
14 |
< |
# DBSAPI/.. |
15 |
< |
# DLSAPI/.. |
16 |
< |
|
12 |
> |
# python/... |
13 |
> |
# script/... |
14 |
> |
# DBSAPI |
15 |
> |
# DLSAPI |
16 |
> |
# |
17 |
|
TopDir=`\pwd` |
18 |
|
|
19 |
|
############################################# |
20 |
|
######## BOSS CONFIGURATION ################# |
21 |
|
############################################# |
22 |
< |
BOSSVER=3_6_1 |
22 |
> |
BOSSVER=3_6_3 |
23 |
|
BACKEND=SQLite |
24 |
|
|
25 |
|
function configureBoss { |
67 |
|
cat > crab.sh <<EOF |
68 |
|
#! /bin/sh |
69 |
|
# CRAB related Stuff |
70 |
< |
export CRABDIR=$TopDir/Crab |
70 |
> |
export CRABDIR=$TopDir |
71 |
|
export CRABSCRIPT=\${CRABDIR} |
72 |
|
|
73 |
|
CRABPATH=\${CRABDIR}/python |
91 |
|
|
92 |
|
# check whether central boss db is configured |
93 |
|
|
94 |
< |
# check if *clad files exist |
95 |
< |
if [ ! -e ~/BossConfig.clad ]; then |
96 |
< |
echo "User-boss DB not installed: run configureBoss" |
97 |
< |
fi |
98 |
< |
if [ ! -e ~/SQLiteConfig.clad ]; then |
99 |
< |
echo "User-boss DB not installed: run configureBoss" |
94 |
> |
# check if .bossrc dir exists |
95 |
> |
|
96 |
> |
if [ ! -d ~/.bossrc ]; then |
97 |
> |
mkdir ~/.bossrc |
98 |
|
fi |
99 |
< |
if [ ! -e ~/MySQLRTConfig.clad ]; then |
100 |
< |
echo "User-boss DB not installed: run configureBoss" |
99 |
> |
|
100 |
> |
# check if *clad files exist |
101 |
> |
|
102 |
> |
if [ ! -e ~/.bossrc/BossConfig.clad ]; then |
103 |
> |
if [ -e ~/BossConfig.clad ]; then |
104 |
> |
cp ~/BossConfig.clad ~/.bossrc/BossConfig.clad |
105 |
> |
else |
106 |
> |
echo "User-boss DB not installed: run configureBoss" |
107 |
> |
fi |
108 |
> |
fi |
109 |
> |
if [ ! -e ~/.bossrc/SQLiteConfig.clad ]; then |
110 |
> |
if [ -e ~/SQLiteConfig.clad ]; then |
111 |
> |
cp ~/SQLiteConfig.clad ~/.bossrc/SQLiteConfig.clad |
112 |
> |
else |
113 |
> |
echo "User-boss DB not installed: run configureBoss" |
114 |
> |
fi |
115 |
> |
fi |
116 |
> |
if [ ! -e ~/.bossrc/MySQLRTConfig.clad ]; then |
117 |
> |
if [ -e ~/MySQLRTConfig.clad ]; then |
118 |
> |
cp ~/MySQLRTConfig.clad ~/.bossrc/MySQLRTConfig.clad |
119 |
> |
else |
120 |
> |
echo "User-boss DB not installed: run configureBoss" |
121 |
> |
fi |
122 |
|
fi |
123 |
|
# now check a boss command to see if boss DB is up and running |
124 |
< |
|
106 |
< |
boss clientID 1>&2 | grep -c "not correctly configured" |
107 |
< |
< if [ \$? -ne 0 ]; then |
124 |
> |
if [ \`boss clientID 1>/dev/null | grep -c "not correctly configured"\` -ne 0 ]; then |
125 |
|
echo "User-boss DB not installed: run configureBoss" |
126 |
|
fi |
127 |
|
EOF |
130 |
|
cat > crab.csh <<EOF |
131 |
|
#! /bin/csh |
132 |
|
# CRAB related Stuff |
133 |
< |
setenv CRABDIR $TopDir/Crab |
133 |
> |
setenv CRABDIR $TopDir |
134 |
|
setenv CRABSCRIPT \${CRABDIR} |
135 |
|
|
136 |
|
set CRABPATH=\${CRABDIR}/python |
154 |
|
|
155 |
|
# check whether central boss db is configured |
156 |
|
|
157 |
+ |
# check if .bossrc dir exists |
158 |
+ |
|
159 |
+ |
if ( ! -d ~/.bossrc ) then |
160 |
+ |
mkdir ~/.bossrc |
161 |
+ |
endif |
162 |
+ |
|
163 |
|
# check if *clad files exist |
164 |
< |
if ( ! -e ~/BossConfig.clad ) then |
165 |
< |
echo "User-boss DB not installed: run configureBoss" |
166 |
< |
exit 1 |
164 |
> |
if ( ! -e ~/.bossrc/BossConfig.clad ) then |
165 |
> |
if ( -e ~/BossConfig.clad ) then |
166 |
> |
cp ~/BossConfig.clad ~/.bossrc/BossConfig.clad |
167 |
> |
else |
168 |
> |
echo "User-boss DB not installed: run configureBoss" |
169 |
> |
exit 1 |
170 |
> |
endif |
171 |
|
endif |
172 |
< |
if ( ! -e ~/SQLiteConfig.clad ) then |
173 |
< |
echo "User-boss DB not installed: run configureBoss" |
174 |
< |
exit 1 |
172 |
> |
if ( ! -e ~/.bossrc/SQLiteConfig.clad ) then |
173 |
> |
if ( -e ~/SQLiteConfig.clad ) then |
174 |
> |
cp ~/SQLiteConfig.clad ~/.bossrc/SQLiteConfig.clad |
175 |
> |
else |
176 |
> |
echo "User-boss DB not installed: run configureBoss" |
177 |
> |
exit 1 |
178 |
> |
endif |
179 |
|
endif |
180 |
< |
if ( ! -e ~/MySQLRTConfig.clad ) then |
181 |
< |
echo "User-boss DB not installed: run configureBoss" |
182 |
< |
exit 1 |
180 |
> |
if ( ! -e ~/.bossrc/MySQLRTConfig.clad ) then |
181 |
> |
if ( -e ~/MySQLRTConfig.clad ) then |
182 |
> |
cp ~/MySQLRTConfig.clad ~/.bossrc/MySQLRTConfig.clad |
183 |
> |
else |
184 |
> |
echo "User-boss DB not installed: run configureBoss" |
185 |
> |
exit 1 |
186 |
> |
endif |
187 |
|
endif |
188 |
|
# now check a boss command to see if boss DB is up and running |
189 |
|
if ( \`boss clientID |& grep -c "not correctly configured"\` ) then |