Skip to content
This repository
Browse code

[services-ng] Add mysql initialized database to blob

Change-Id: I72ba57c656a074411fcdde34330c21ae874609de
  • Loading branch information...
commit 22fecd1469b5c5f6302800b404b9c5621cba976c 1 parent 5a5ee11
Eagle Chen EagleChen authored
8 config/blobs.yml
@@ -679,3 +679,11 @@ postgresql/postgresql-initdb-9.1-x86_64.tar.gz:
679 679 object_id: eyJvaWQiOiI0ZTRlNzhiY2ExMWUxMjEwMDRlNGU3ZDUxMWY4MjEwNTBiMzNl%0AMDgwNWZmOCIsInNpZyI6IjhsL2ZWQXhRWFZrSTF5TmpBY3M2ME13VnlHTT0i%0AfQ==%0A
680 680 sha: c51a45f5a6011a6bb22407c164ea9b77f77cddad
681 681 size: 3911161
  682 +mysql/mysql-initdb-5.1.62-rel13.3-435-Linux-x86_64.tar.gz:
  683 + object_id: eyJvaWQiOiI0ZTRlNzhiY2EzMWUxMjIyMDRlNGU5ODYzYjFiNzQwNTBhYzhj%0ANmFiOGZlZSIsInNpZyI6Impod3ZrZmw3dVFDamtGSFRUdktyQWtzdkFxRT0i%0AfQ==%0A
  684 + sha: 8122bcd96c3fa251ce6a4317570d01b4bf2b8420
  685 + size: 53356
  686 +mysql/mysql-initdb-5.5.27-rel28.1-296.Linux.x86_64.tar.gz:
  687 + object_id: eyJvaWQiOiI0ZTRlNzhiY2E0MWUxMjEwMDRlNGU3ZDUxNzYxOGYwNTBhYzhj%0ANmQ0YmJmZCIsInNpZyI6IjdPcDdjUTlBNG1kd1dTM1BxQVFoTWVBN1JBND0i%0AfQ==%0A
  688 + sha: 13b525536fb903414691d470a5cae89dad64b004
  689 + size: 422353
64 jobs/mysql_node_ng/templates/warden_ctl
@@ -7,64 +7,6 @@ MYSQL55_DIR=/var/vcap/packages/mysql55
7 7
8 8 source /var/vcap/packages/mysql_node_ng/common/services/utils.sh
9 9
10   -create_initdb () {
11   - initdb_name=$1
12   - mysql_dir=$2
13   - i=0
14   - server_startup_timeout=10
15   - server_shutdown_timeout=10
16   -
17   - rm -rf $ROOT_DIR/$mysql_dir/$initdb_name
18   - rm -rf /var/vcap/data/$initdb_name
19   - mkdir -p /var/vcap/data/$initdb_name
20   - chmod -R 1777 /var/vcap/data/$initdb_name
21   -
22   - echo "Initialize data directory for mysql in $mysql_dir"
23   -
24   - $mysql_dir/bin/mysql_install_db --basedir=$mysql_dir --user=vcap \
25   - --datadir=/var/vcap/data/$initdb_name
26   - cd $mysql_dir
27   - ./bin/mysqld_safe --user=vcap --datadir=/var/vcap/data/$initdb_name &
28   -
29   - while test $i -ne $server_startup_timeout; do
30   - if test -s /var/vcap/data/$initdb_name/*.pid; then
31   - i='' && break
32   - fi
33   - sleep 1
34   - i=`expr $i + 1`
35   - done
36   -
37   - if test -n "$i"; then
38   - echo "Fail to start the temporary mysql server in $msyql_dir"
39   - exit 1
40   - fi
41   -
42   - export LD_LIBRARY_PATH=$mysql_dir/lib/mysql
43   - ./bin/mysqladmin shutdown
44   - i=0
45   - while test $i -ne $server_shutdown_timeout; do
46   - if test ! -s /var/vcap/data/$initdb_name/*.pid; then
47   - i='' && break
48   - fi
49   - sleep 1
50   - i=`expr $i + 1`
51   - done
52   -
53   - if test -n "$i"; then
54   - echo "Fail to shutdown the temporary mysql server in $mysql_dir"
55   - exit 1
56   - fi
57   -
58   - if test ! -d /var/vcap/data/$initdb_name/mysql; then
59   - echo "Fail to initialize database directory in $mysql_dir"
60   - exit 1
61   - fi
62   -
63   - rsync -arl --exclude=test --exclude=*.err \
64   - /var/vcap/data/$initdb_name $ROOT_DIR/$mysql_dir
65   - chmod -R 777 $ROOT_DIR/$mysql_dir/$initdb_name
66   -}
67   -
68 10 case $1 in
69 11
70 12 start)
@@ -94,8 +36,10 @@ case $1 in
94 36
95 37 install -m 0755 -t $ROOT_DIR/usr/sbin $JOB_DIR/bin/pre_service_start.sh
96 38
97   - create_initdb "initdb" $MYSQL_DIR
98   - create_initdb "initdb55" $MYSQL55_DIR
  39 + rm -rf $ROOT_DIR/$MYSQL_DIR/initdb
  40 + rsync -arl $MYSQL_DIR/initdb $ROOT_DIR/$MYSQL_DIR
  41 + rm -rf $ROOT_DIR/$MYSQL55_DIR/initdb55
  42 + rsync -arl $MYSQL55_DIR/initdb55 $ROOT_DIR/$MYSQL55_DIR
99 43
100 44 echo "Starting warden."
101 45
5 packages/mysql/packaging
@@ -11,5 +11,10 @@ tar zxvf mysql/server-$VERSION.tar.gz
11 11 done
12 12 )
13 13
  14 +# initialized database
  15 +tar zxvf mysql/mysql-initdb-$VERSION.tar.gz
  16 +
  17 +cp -a initdb ${BOSH_INSTALL_TARGET}
  18 +
14 19 cp -v mysql/mysql.server ${BOSH_INSTALL_TARGET}/libexec/mysql.server
15 20 cp -v mysql/mysql_warden.server ${BOSH_INSTALL_TARGET}/libexec/mysql_warden.server
1  packages/mysql/spec
@@ -2,5 +2,6 @@
2 2 name: mysql
3 3 files:
4 4 - mysql/server-5.1.62-rel13.3-435-Linux-x86_64.tar.gz
  5 +- mysql/mysql-initdb-5.1.62-rel13.3-435-Linux-x86_64.tar.gz
5 6 - mysql/mysql.server
6 7 - mysql/mysql_warden.server
5 packages/mysql55/packaging
@@ -11,5 +11,10 @@ tar zxvf mysql/server-$VERSION.tar.gz
11 11 done
12 12 )
13 13
  14 +# initialized database
  15 +tar zxvf mysql/mysql-initdb-$VERSION.tar.gz
  16 +
  17 +cp -a initdb55 ${BOSH_INSTALL_TARGET}
  18 +
14 19 cp -v mysql/mysql55.server ${BOSH_INSTALL_TARGET}/libexec/mysql.server
15 20 cp -v mysql/mysql55_warden.server ${BOSH_INSTALL_TARGET}/libexec/mysql_warden.server
1  packages/mysql55/spec
@@ -2,5 +2,6 @@
2 2 name: mysql55
3 3 files:
4 4 - mysql/server-5.5.27-rel28.1-296.Linux.x86_64.tar.gz
  5 +- mysql/mysql-initdb-5.5.27-rel28.1-296.Linux.x86_64.tar.gz
5 6 - mysql/mysql55.server
6 7 - mysql/mysql55_warden.server

Git Notes

review

Code-Review+1: Andrew Liu <aliu@vmware.com>
Code-Review+2: Nicholas Kushmerick <nicholask@vmware.com>
Verified+1: CI Master <cf-ci@rbcon.com>
Submitted-by: Yanguang Chen <yanguangchen@rbcon.com>
Submitted-at: Sat, 01 Dec 2012 01:55:50 +0000
Reviewed-on: http://reviews.cloudfoundry.org/11674
Project: cf-release
Branch: refs/heads/master

0 comments on commit 22fecd1

Please sign in to comment.
Something went wrong with that request. Please try again.