Skip to content

Commit bc2a88d

Browse files
author
Adam Spiers
committed
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
1 parent 8b9864d commit bc2a88d

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

lib/databases/mysql

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,13 @@ MYSQL_DRIVER=${MYSQL_DRIVER:-PyMySQL}
1616
register_database mysql
1717

1818
MYSQL_SERVICE_NAME=mysql
19-
if is_suse || is_fedora && ! is_oraclelinux; then
19+
if is_fedora && ! is_oraclelinux; then
20+
MYSQL_SERVICE_NAME=mariadb
21+
elif is_suse && systemctl list-unit-files | grep -q 'mariadb\.service'; then
22+
# Older mariadb packages on SLES 12 provided mysql.service. The
23+
# newer ones on SLES 12 and 15 use mariadb.service; they also
24+
# provide a mysql.service symlink for backwards-compatibility, but
25+
# let's not rely on that.
2026
MYSQL_SERVICE_NAME=mariadb
2127
fi
2228

0 commit comments

Comments
 (0)