1 |
< |
### RPM cms dbs-server DBS_1_0_8 |
1 |
> |
### RPM cms dbs-server DBS_1_1_2e |
2 |
|
|
3 |
|
%define cvstag %v |
4 |
|
Source: cvs://:pserver:anonymous@cmscvs.cern.ch:2401/cvs_server/repositories/CMSSW?passwd=AA_:yZZ3e&module=DBS/Servers/JavaServer&export=DBS&tag=-r%{cvstag}&output=/dbs-server.tar.gz |
15 |
|
# fix context.xml file |
16 |
|
cat > etc/context.xml << EOF_CONTEXT |
17 |
|
<Context path="/servlet/DBSServlet" docBase="DBSServlet" debug="5" reloadable="true" crossContext="true"> |
18 |
< |
<SupportedSchemaVersion schemaversion="DBS_1_0_8" /> |
19 |
< |
<SupportedClientVersions clientversions="DBS_1_0_1, DBS_1_0_5, DBS_1_0_7, DBS_1_0_8, DBS_1_0_9"/> |
18 |
> |
<SupportedSchemaVersion schemaversion="DBS_1_0_9" /> |
19 |
> |
<SupportedClientVersions clientversions="DBS_1_0_1, DBS_1_0_5, DBS_1_0_7, DBS_1_0_8, DBS_1_0_9, DBS_1_1_2"/> |
20 |
|
<DBSBlockConfig maxBlockSize="2000000000000" maxBlockFiles="100" /> |
21 |
|
|
22 |
|
<Resource name="jdbc/dbs" |
53 |
|
export MYAREA=rpm_install_area |
54 |
|
export SCRAM_ARCH=slc4_ia32_gcc345 |
55 |
|
source \$MYAREA/\$SCRAM_ARCH/external/apt/0.5.15lorg3.2-CMS3/etc/profile.d/init.sh |
56 |
< |
source \$DBS_SERVER_ROOT/etc/profile.d/init.sh |
56 |
> |
source \$MYAREA/%{pkgrel}/etc/profile.d/init.sh |
57 |
|
# set DBS DBs |
58 |
|
MYSQL_PORT=3316 |
59 |
|
MYSQL_PATH=\$MYSQL_ROOT/mysqldb |
63 |
|
|
64 |
|
function dbs_stop() |
65 |
|
{ |
66 |
< |
echo $"Stop mysqld|tomcat running under `whoami` account..." |
67 |
< |
ps -w -w -f -u`whoami` | egrep "mysqld|tomcat" | grep -v egrep | awk '{print "kill -9 "\$2""}'|/bin/sh |
66 |
> |
me=\`whoami\` |
67 |
> |
echo $"Stop mysqld|tomcat running under \$me account..." |
68 |
> |
ps -w -w -f -u\$me | egrep "mysqld|tomcat" | grep -v egrep | awk '{print "kill -9 "\$2""}'|/bin/sh |
69 |
|
} |
70 |
|
function dbs_start() |
71 |
|
{ |
91 |
|
echo "MySQL server is not running" |
92 |
|
exit 1 |
93 |
|
fi |
94 |
< |
ps -w -w -f -u`whoami` | egrep "mysqld" | grep -v egrep | awk '{print "MySQLd server running, pid="\$2""}' |
95 |
< |
ps -w -w -f -u`whoami` | egrep "tomcat" | grep -v egrep | awk '{print "Tomcat server running, pid="\$2""}' |
94 |
> |
ps -w -w -f -u\$me | egrep "mysqld" | grep -v egrep | awk '{print "MySQLd server running, pid="\$2""}' |
95 |
> |
ps -w -w -f -u\$me | egrep "tomcat" | grep -v egrep | awk '{print "Tomcat server running, pid="\$2""}' |
96 |
|
echo "For more information please have a look at tomcat log:" |
97 |
|
echo "\$APACHE_TOMCAT_ROOT/logs/catalina.out" |
98 |
|
} |
167 |
|
MYSQL_ERR=$MYSQL_PATH/error.log |
168 |
|
# grant permissions to CMS MySQL DBS account |
169 |
|
echo "+++ Grand permission to dbs account, DBS DB ${DBS_SCHEMA_VERSION} ..." |
170 |
< |
echo "$MYSQL_ROOT/bin/mysql -udbs -pcmsdbs --socket=$MYSQL_SOCK" |
170 |
> |
#echo "$MYSQL_ROOT/bin/mysql -udbs -pcmsdbs --socket=$MYSQL_SOCK" |
171 |
|
echo "$DBS_SCHEMA_ROOT/Schema/NeXtGen/DBS-NeXtGen-MySQL_DEPLOYABLE.sql" |
172 |
|
# DBS uses trigger which requires to have SUPER priveleges, so we'll create DB using root |
173 |
|
# and delegate this to dbs account. |
177 |
|
# I need to copy/deploy DBS.war file into tomcat area |
178 |
|
cp $DBS_SERVER_ROOT/Servers/JavaServer/DBS.war $APACHE_TOMCAT_ROOT/webapps |
179 |
|
|
179 |
– |
echo |
180 |
– |
echo |
181 |
– |
echo "##### IMPORTANT!!! #####" |
182 |
– |
echo "For your convinience we created" |
183 |
– |
echo "$DBS_SERVER_ROOT/Servers/JavaServer/bin/dbs_init.sh" |
184 |
– |
echo "init script file which can be placed into /etc/init.d/ to allow auto-startup of DBS service" |
185 |
– |
echo "##### END OF README #####" |
186 |
– |
echo |
180 |
|
# Fix path in dbs_init.sh file since now we know install area |
181 |
|
cat $DBS_SERVER_ROOT/Servers/JavaServer/bin/dbs_init.sh | sed "s,rpm_install_area,$RPM_INSTALL_PREFIX,g" > \ |
182 |
|
$DBS_SERVER_ROOT/Servers/JavaServer/bin/dbs_init.sh.new |
183 |
< |
mv $DBS_SERVER_ROOT/Servers/JavaServer/bin/dbs_init.sh.new $DBS_SERVER_ROOT/Servers/JavaServer/bin/dbs_init.sh |
183 |
> |
/bin/mv -f $DBS_SERVER_ROOT/Servers/JavaServer/bin/dbs_init.sh.new $DBS_SERVER_ROOT/Servers/JavaServer/bin/dbs_init.sh |
184 |
> |
echo "+++ Fix path in dbs_init.sh" |
185 |
|
chmod a+x $DBS_SERVER_ROOT/Servers/JavaServer/bin/dbs_init.sh |
186 |
|
|
187 |
|
# time to start up tomcat for user |
188 |
|
#$APACHE_TOMCAT_ROOT/bin/catalina.sh start |
189 |
|
|
190 |
|
# kill running mysql|tomcat under my account since build is over |
191 |
+ |
echo "+++ Clean-up mysqld|tomcat processes" |
192 |
|
ps -w -w -f -u`whoami` | egrep "mysqld|tomcat" | grep -v egrep | awk '{print "kill -9 "$2""}' |/bin/sh |
193 |
+ |
|
194 |
+ |
echo |
195 |
+ |
echo |
196 |
+ |
echo "##### IMPORTANT!!! #####" |
197 |
+ |
echo "For your convinience we created" |
198 |
+ |
echo "$DBS_SERVER_ROOT/Servers/JavaServer/bin/dbs_init.sh" |
199 |
+ |
echo "init script file which can be placed into /etc/init.d/ to allow auto-startup of DBS service" |
200 |
+ |
echo "##### END OF README #####" |
201 |
+ |
echo |
202 |
+ |
|