From bc2a88d1f493f4f0784650e5ac959e8677495669 Mon Sep 17 00:00:00 2001 From: Adam Spiers Date: Thu, 24 Jan 2019 18:57:33 +0000 Subject: [PATCH] On SUSE-based systems, check whether we have mariadb or mysql service Older mariadb packages on SLES 12 provided mysql.service. The newer ones on SLES 12 and 15 use mariadb.service; they also provide a mysql.service symlink for backwards-compatibility, but let's not rely on that. Change-Id: Ife6bd007ba30af0b77d44832b19d518034bdb12b --- lib/databases/mysql | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/databases/mysql b/lib/databases/mysql index ac0c083c91..4d0f5f3e45 100644 --- a/lib/databases/mysql +++ b/lib/databases/mysql @@ -16,7 +16,13 @@ MYSQL_DRIVER=${MYSQL_DRIVER:-PyMySQL} register_database mysql MYSQL_SERVICE_NAME=mysql -if is_suse || is_fedora && ! is_oraclelinux; then +if is_fedora && ! is_oraclelinux; then + MYSQL_SERVICE_NAME=mariadb +elif is_suse && systemctl list-unit-files | grep -q 'mariadb\.service'; then + # Older mariadb packages on SLES 12 provided mysql.service. The + # newer ones on SLES 12 and 15 use mariadb.service; they also + # provide a mysql.service symlink for backwards-compatibility, but + # let's not rely on that. MYSQL_SERVICE_NAME=mariadb fi