diff --git a/slapos/recipe/generic_mysql/mysql.py b/slapos/recipe/generic_mysql/mysql.py index 8ba7f3c57d39c170b3533b6791c33d0df5e8bbff..112e520f1cefa9e3e96fe6d0f60f624d2a9f4c47 100644 --- a/slapos/recipe/generic_mysql/mysql.py +++ b/slapos/recipe/generic_mysql/mysql.py @@ -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) diff --git a/software/mariadb/instance-mariadb.cfg b/software/mariadb/instance-mariadb.cfg index 54d0c8f29069bc42c919c9472ecd08e0acfec1e3..c681bf4f80a8ae93444b0fc389e55100a760e0e6 100644 --- a/software/mariadb/instance-mariadb.cfg +++ b/software/mariadb/instance-mariadb.cfg @@ -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 diff --git a/software/mariadb/software.cfg b/software/mariadb/software.cfg index 2ba926cae766753f6c1d5ae40e214a5fb87613d4..83e49b01c85c8cb81bb3bd4a12d0c1c4da519581 100644 --- a/software/mariadb/software.cfg +++ b/software/mariadb/software.cfg @@ -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 diff --git a/stack/erp5/buildout.cfg b/stack/erp5/buildout.cfg index ad14c8050a6aa76172c01f3974e545f060ebff5f..d908a89fdffb8b3839e2e9ed5b4e40631ef1bdee 100644 --- a/stack/erp5/buildout.cfg +++ b/stack/erp5/buildout.cfg @@ -173,7 +173,7 @@ context = [template-mariadb] < = download-base filename = instance-mariadb.cfg.in -md5sum = defc8f21dd651dab65102f889740a4e5 +md5sum = 60f5e662d7301e3d56c51f934ea4a303 [template-zope] < = download-base diff --git a/stack/erp5/instance-mariadb.cfg.in b/stack/erp5/instance-mariadb.cfg.in index 4558ef970c83a9e3d658cdbef6e0d354c425a411..3b4348c539a21d0fd04077b750ca5ea17f6d207f 100644 --- a/stack/erp5/instance-mariadb.cfg.in +++ b/stack/erp5/instance-mariadb.cfg.in @@ -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