Commit bb8ab8ae authored by Benjamin Blanc's avatar Benjamin Blanc

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

parent 047b844d
......@@ -17,7 +17,7 @@ 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',
'--skip-name-resolve',
'--datadir=%s' % conf['data_directory'],
'--basedir=%s' % conf['mysql_base_directory']],
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
......@@ -52,7 +52,7 @@ 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.insert(1)
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]
......@@ -67,7 +67,7 @@ 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.insert(1)
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
......
......@@ -146,7 +146,7 @@ mode = 640
[slapos.cookbook-repository]
recipe = slapos.recipe.build:gitclone
repository = http://git.erp5.org/repos/slapos.git
branch = erp5
branch = erp5-cluster
git-executable = ${git:location}/bin/git
[check-recipe]
......@@ -184,7 +184,7 @@ context =
[template-mariadb]
< = download-base
filename = instance-mariadb.cfg.in
md5sum = 1d202667c98a5bcc448eb5f61cbbf1e3
md5sum = 8f4883b0b3f01515a2e3b9ed59f55497
[template-zope]
< = download-base
......@@ -287,7 +287,7 @@ extra-context =
[template-erp5-single]
< = download-base
filename = instance-erp5-single.cfg.in
md5sum = d35e94974cd4cb8838e205a96f5ec0ba
md5sum = 69961d8b60ce529baaf958dc76537ac5
[template-erp5-cluster]
< = download-base
......
......@@ -89,9 +89,10 @@ context = section parameter_dict init-script-parameters
[update-mysql]
recipe = slapos.cookbook:generic.mysql.wrap_update_mysql
output = ${directory:services}/mariadb_update
binary = ${binary-wap-mysql_upgrade:output}
binary = ${binary-wrap-mysql_upgrade:output}
mysql = ${binary-wrap-mysql:output}
init-script = ${init-script:rendered}
mysql_tzinfo_to_sql = ${binary-wrap-mysql_tzinfo_to_sql:output}
[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:output}" --no-defaults -B -u root -e "FLUSH LOGS"
post = "${binary-wrap-mysql:output}" -B -u root -e "FLUSH LOGS"
[cron]
recipe = slapos.cookbook:cron
......@@ -182,9 +183,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