summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimotheus Pokorra <tp@tbits.net>2015-02-12 15:17:51 +0100
committerTimotheus Pokorra <timotheus.pokorra@solidcharity.com>2015-02-13 12:24:00 +0100
commitfd84ecba7e83719f444d930b31d3415056b1c732 (patch)
tree9fc247129f247f019a2a3970c4bbd2125eb482bc
parent86a54625c8149ef51c9f62a4675acd5242d8b387 (diff)
downloadpykolab-fd84ecba7e83719f444d930b31d3415056b1c732.tar.gz
on CentOS7, there is MariaDB instead of MySQL. fixing bug 3877
-rw-r--r--pykolab/setup/setup_mysql.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/pykolab/setup/setup_mysql.py b/pykolab/setup/setup_mysql.py
index 2211876..174cbc7 100644
--- a/pykolab/setup/setup_mysql.py
+++ b/pykolab/setup/setup_mysql.py
@@ -39,8 +39,13 @@ def description():
return _("Setup MySQL.")
def execute(*args, **kw):
+ # on CentOS7, there is MariaDB instead of MySQL
+ mysqlservice = 'mysqld.service'
+ if os.path.isfile('/usr/lib/systemd/system/mariadb.service'):
+ mysqlservice = 'mariadb.service'
+
if os.path.isfile('/bin/systemctl'):
- subprocess.call(['/bin/systemctl', 'restart', 'mysqld.service'])
+ subprocess.call(['/bin/systemctl', 'restart', mysqlservice])
elif os.path.isfile('/sbin/service'):
subprocess.call(['/sbin/service', 'mysqld', 'restart'])
elif os.path.isfile('/usr/sbin/service'):
@@ -49,7 +54,7 @@ def execute(*args, **kw):
log.error(_("Could not start the MySQL database service."))
if os.path.isfile('/bin/systemctl'):
- subprocess.call(['/bin/systemctl', 'enable', 'mysqld.service'])
+ subprocess.call(['/bin/systemctl', 'enable', mysqlservice])
elif os.path.isfile('/sbin/chkconfig'):
subprocess.call(['/sbin/chkconfig', 'mysqld', 'on'])
elif os.path.isfile('/usr/sbin/update-rc.d'):