Commit 8b95e4be authored by Benjamin Blanc's avatar Benjamin Blanc Committed by Vincent Pelletier

Add a mysql_tzinfo_to_sql wrapper for mariadb and remove --no-default param

vincent: Minor fixes. Move branch switch to a separate commit.
vincent: Provide configuration to mysql_install_binary.
parent 761bed51
......@@ -17,7 +17,8 @@ def runMysql(args):
# XXX: Protect with proper root password
# XXX: Follow http://dev.mysql.com/doc/refman/5.0/en/default-privileges.html
popen = subprocess.Popen([conf['mysql_install_binary'],
'--skip-name-resolve', '--no-defaults',
'--defaults-file=%s' % conf['configuration_file'],
'--skip-name-resolve',
'--datadir=%s' % conf['data_directory'],
'--basedir=%s' % conf['mysql_base_directory']],
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
......@@ -68,7 +69,6 @@ def updateMysql(args):
while True:
mysql_upgrade_list = [conf['mysql_upgrade_binary'], '--user=root']
if 'socket' in conf:
mysql_upgrade_list.insert(1, '--no-defaults')
mysql_upgrade_list.append('--socket=' + conf['socket'])
mysql_upgrade = subprocess.Popen(mysql_upgrade_list, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
result = mysql_upgrade.communicate()[0]
......@@ -83,7 +83,6 @@ def updateMysql(args):
print "No need to upgrade MySQL database"
mysql_list = [conf['mysql_binary'].strip(), '-B', '--user=root']
if 'socket' in conf:
mysql_list.insert(1, '--no-defaults')
mysql_list.append('--socket=' + conf['socket'])
mysql = subprocess.Popen(mysql_list, stdin=subprocess.PIPE,
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
......
......@@ -53,7 +53,7 @@ mysqld-binary = ${mariadb:location}/bin/mysqld
mysqldump-binary = ${mariadb:location}/bin/mysqldump
gzip-binary = $${buildout:gzip-binary}
zcat-binary = ${gzip:location}/bin/zcat
mysql-tzinfo-to-sql-binary = ${mariadb:location}/bin/mysql_tzinfo_to_sql
[certificate-authority]
recipe = slapos.cookbook:certificate_authority
......
......@@ -48,7 +48,7 @@ mode = 0644
[instance-mariadb]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-mariadb.cfg
md5sum = d160bb15d8d3a3913706a4ed29c49388
md5sum = 79f86f8c74335b2b9ec81d6a02164cbf
output = ${buildout:directory}/template-mariadb.cfg
mode = 0644
......
......@@ -173,7 +173,7 @@ context =
[template-mariadb]
< = download-base
filename = instance-mariadb.cfg.in
md5sum = defc8f21dd651dab65102f889740a4e5
md5sum = 60f5e662d7301e3d56c51f934ea4a303
[template-zope]
< = download-base
......
......@@ -92,6 +92,7 @@ output = ${directory:services}/mariadb_update
binary = ${binary-wrap-mysql_upgrade:wrapper-path}
mysql = ${binary-wrap-mysql:wrapper-path}
init-script = ${init-script:rendered}
mysql_tzinfo_to_sql = ${binary-wrap-mysql_tzinfo_to_sql:wrapper-path}
[mysqld]
recipe = slapos.cookbook:generic.mysql.wrap_mysqld
......@@ -130,7 +131,7 @@ state-file = ${directory:srv}/logrotate.status
recipe = slapos.cookbook:logrotate.d
name = mariadb
log = ${my-cnf-parameters:error-log} ${my-cnf-parameters:slow-query-log}
post = "${binary-wrap-mysql:wrapper-path}" --no-defaults -B -u root -e "FLUSH LOGS"
post = "${binary-wrap-mysql:wrapper-path}" -B -u root -e "FLUSH LOGS"
[cron]
recipe = slapos.cookbook:cron
......@@ -183,9 +184,13 @@ command = mysql
< = binary-wrap-base
command = mysqldump
[binary-wap-mysql_upgrade]
[binary-wrap-mysql_upgrade]
< = binary-wrap-base
command-line = mysql_upgrade
command = mysql_upgrade
[binary-wrap-mysql_tzinfo_to_sql]
< = binary-wrap-base
command = mysql_tzinfo_to_sql
[directory]
recipe = slapos.cookbook:mkdirectory
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment