From 6f6a3f2af93ec0a1afc0a4ecebe5f7d79534c277 Mon Sep 17 00:00:00 2001 From: Petr Malik Date: Thu, 12 May 2016 20:36:40 -0400 Subject: [PATCH] Define safe pid-file and socket paths in config Service manager cannot properly manage the MySQL process if the pid file / socket are not defined for the mysql_safe process. Also rename 'pid_file' to 'pid-file', default for both 5.6 and 5.7 and the only name accepted in the 'mysql_safe' section. Update MySQL derivatives: MySQL, Percona and PXC. Change-Id: I44441144a74e01d3c816ca72b2da4aa351dbd46c Closes-Bug: 1605385 --- .../db-get-default-instance-configuration-response-json.txt | 2 +- .../db-get-default-instance-configuration-response.json | 3 ++- trove/templates/mysql/config.template | 6 +++++- trove/templates/percona/config.template | 6 +++++- trove/templates/pxc/config.template | 6 +++++- 5 files changed, 18 insertions(+), 5 deletions(-) diff --git a/apidocs/src/samples/db-get-default-instance-configuration-response-json.txt b/apidocs/src/samples/db-get-default-instance-configuration-response-json.txt index 920b516fe6..fc7243ceda 100644 --- a/apidocs/src/samples/db-get-default-instance-configuration-response-json.txt +++ b/apidocs/src/samples/db-get-default-instance-configuration-response-json.txt @@ -1,5 +1,5 @@ HTTP/1.1 200 OK Content-Type: application/json -Content-Length: 1094 +Content-Length: 1135 Date: Mon, 18 Mar 2013 19:09:17 GMT diff --git a/apidocs/src/samples/db-get-default-instance-configuration-response.json b/apidocs/src/samples/db-get-default-instance-configuration-response.json index 7fa824d7ab..e5d9ecf614 100644 --- a/apidocs/src/samples/db-get-default-instance-configuration-response.json +++ b/apidocs/src/samples/db-get-default-instance-configuration-response.json @@ -20,7 +20,8 @@ "max_user_connections": 100, "myisam-recover-options": "BACKUP,FORCE", "open_files_limit": 512, - "pid_file": "/var/run/mysqld/mysqld.pid", + "pid-file": "/var/run/mysqld/mysqld.pid", + "socket": "/var/run/mysqld/mysqld.sock", "port": 3306, "query_cache_limit": "1M", "query_cache_size": "8M", diff --git a/trove/templates/mysql/config.template b/trove/templates/mysql/config.template index 70f8f27d7a..7f0ef517a7 100644 --- a/trove/templates/mysql/config.template +++ b/trove/templates/mysql/config.template @@ -1,7 +1,10 @@ [client] port = 3306 +socket = /var/run/mysqld/mysqld.sock [mysqld_safe] +pid-file = /var/run/mysqld/mysqld.pid +socket = /var/run/mysqld/mysqld.sock nice = 0 [mysqld] @@ -10,7 +13,8 @@ port = 3306 basedir = /usr datadir = /var/lib/mysql/data tmpdir = /var/tmp -pid_file = /var/run/mysqld/mysqld.pid +pid-file = /var/run/mysqld/mysqld.pid +socket = /var/run/mysqld/mysqld.sock skip-external-locking = 1 key_buffer_size = {{ (50 * flavor['ram']/512)|int }}M max_allowed_packet = {{ (1024 * flavor['ram']/512)|int }}K diff --git a/trove/templates/percona/config.template b/trove/templates/percona/config.template index 83807944d2..d1f743fd0c 100644 --- a/trove/templates/percona/config.template +++ b/trove/templates/percona/config.template @@ -1,7 +1,10 @@ [client] port = 3306 +socket = /var/run/mysqld/mysqld.sock [mysqld_safe] +pid-file = /var/run/mysqld/mysqld.pid +socket = /var/run/mysqld/mysqld.sock nice = 0 [mysqld] @@ -10,7 +13,8 @@ port = 3306 basedir = /usr datadir = /var/lib/mysql/data tmpdir = /var/tmp -pid_file = /var/run/mysqld/mysqld.pid +pid-file = /var/run/mysqld/mysqld.pid +socket = /var/run/mysqld/mysqld.sock skip-external-locking = 1 key_buffer_size = {{ (50 * flavor['ram']/512)|int }}M max_allowed_packet = {{ (1024 * flavor['ram']/512)|int }}K diff --git a/trove/templates/pxc/config.template b/trove/templates/pxc/config.template index 83807944d2..d1f743fd0c 100644 --- a/trove/templates/pxc/config.template +++ b/trove/templates/pxc/config.template @@ -1,7 +1,10 @@ [client] port = 3306 +socket = /var/run/mysqld/mysqld.sock [mysqld_safe] +pid-file = /var/run/mysqld/mysqld.pid +socket = /var/run/mysqld/mysqld.sock nice = 0 [mysqld] @@ -10,7 +13,8 @@ port = 3306 basedir = /usr datadir = /var/lib/mysql/data tmpdir = /var/tmp -pid_file = /var/run/mysqld/mysqld.pid +pid-file = /var/run/mysqld/mysqld.pid +socket = /var/run/mysqld/mysqld.sock skip-external-locking = 1 key_buffer_size = {{ (50 * flavor['ram']/512)|int }}M max_allowed_packet = {{ (1024 * flavor['ram']/512)|int }}K