From 3de6c1b2aad889e239037bca28539f68f03339d5 Mon Sep 17 00:00:00 2001 From: Hirotaka Wakabayashi Date: Tue, 24 Jan 2023 02:34:29 +0900 Subject: [PATCH] Creates the mysqld extra configuration dir This PR makes guest-agent create the mysqld extra configuration dir. The original problem is that guest-agent fails to start mysql service with the following error message: ``` mysqld: Can't read dir of '/etc/mysql/mysql.conf.d/' (Errcode: 2 - No such file or directory) ``` Story: 2010543 Task: 47205 Change-Id: Ib1fcc64d5f27bf595d4b4c1d4e145136160bf842 --- trove/guestagent/datastore/mysql_common/service.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/trove/guestagent/datastore/mysql_common/service.py b/trove/guestagent/datastore/mysql_common/service.py index ca1e530ec0..e9bd50c69e 100644 --- a/trove/guestagent/datastore/mysql_common/service.py +++ b/trove/guestagent/datastore/mysql_common/service.py @@ -589,7 +589,8 @@ class BaseMySqlApp(service.BaseDbApp): user = "%s:%s" % (CONF.database_service_uid, CONF.database_service_uid) # Create folders for mysql on localhost - for folder in ['/etc/mysql', '/var/run/mysqld']: + for folder in ['/etc/mysql', '/var/run/mysqld', + '/etc/mysql/mysql.conf.d']: operating_system.ensure_directory( folder, user=CONF.database_service_uid, group=CONF.database_service_uid, force=True, @@ -663,7 +664,8 @@ class BaseMySqlApp(service.BaseDbApp): LOG.info("Restarting mysql") # Ensure folders permission for database. - for folder in ['/etc/mysql', '/var/run/mysqld']: + for folder in ['/etc/mysql', '/var/run/mysqld', + '/etc/mysql/mysql.conf.d']: operating_system.ensure_directory( folder, user=CONF.database_service_uid, group=CONF.database_service_uid, force=True,