From 7a9350c44ff0727dc69fc13f64822c26f032605c Mon Sep 17 00:00:00 2001 From: Matthew Trescott Date: Mon, 5 Mar 2018 20:24:40 -0500 Subject: [PATCH] Quick fix for mistake --- distros/ubuntu1804/zoneminder.postinst | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/distros/ubuntu1804/zoneminder.postinst b/distros/ubuntu1804/zoneminder.postinst index 65c023dd1..4c72a3ba3 100644 --- a/distros/ubuntu1804/zoneminder.postinst +++ b/distros/ubuntu1804/zoneminder.postinst @@ -29,17 +29,19 @@ if [ "$1" = "configure" ]; then # $(systemctl status mysql.service >/dev/null 2>&1); MYSQL_STATUS=$? $(systemctl status mariadb.service >/dev/null 2>&1); MARIADB_STATUS=$? + + # 3 = inactive, 4 = nonexistant + if [ "$MARIADB_STATUS" != "4" ]; then + DBSERVICE="mariadb.service" + else + DBSERVICE="mysql.service" + fi + if [ "$MYSQL_STATUS" != "0" ] && [ "$MARIADB_STATUS" != "0" ]; then # 3 = inactive, 4 = nonexistant # Due to /etc/init.d service autogeneration, mysql.service always returns the status of mariadb.service - # However, mariadb.service - if [ "$MARIADB_STATUS" = "3" ]; then - DBSERVICE="mariadb.service" - deb-systemd-invoke start mariadb.service - elif [ "$MYSQL_STATUS" = "3" ]; then - DBSERVICE="mysql.service" - deb-systemd-invoke start mysql.service - fi + # However, mariadb.service will not return the status of mysql.service. + deb-systemd-invoke start $DBSERVICE fi # Make sure systemctl status exit code is 0; i.e. the DB is running