File fix-db.patch of Package openstack-utils

Index: utils/openstack-db
===================================================================
--- utils/openstack-db.orig
+++ utils/openstack-db
@@ -88,9 +88,9 @@ esac
 
 install_mysql_server() {
   if [ -z "${ASSUME_YES}" ]; then
-    yum install mysql-server
+    zypper install mariadb mariadb-client
   else
-    yum install -y mysql-server
+    zypper install -y mariadb mariadb-client
   fi
 }
 
@@ -143,15 +143,15 @@ fi
 # Make sure MySQL is installed.
 
 NEW_MYSQL_INSTALL=0
-if ! rpm -q --whatprovides mysql-server > /dev/null; then
+if ! rpm -q --whatprovides mariadb > /dev/null; then
   if [ -z "${ASSUME_YES}" ]; then
-    printf "mysql-server is not installed.  Would you like to install it now? (y/n): "
+    printf "mariadb is not installed.  Would you like to install it now? (y/n): "
     read response
     case "$response" in
       y|Y)
         ;;
       n|N)
-        echo "mysql-server must be installed.  Please install it before proceeding."
+        echo "mariadb must be installed.  Please install it before proceeding."
         exit 0
         ;;
       *)
@@ -167,7 +167,7 @@ fi
 
 # Make sure mysqld is running.
 
-if ! service_running mysqld; then
+if ! service_running mysql; then
   if [ -z "${ASSUME_YES}" ]; then
     printf "mysqld is not running.  Would you like to start it now? (y/n): "
     read response
@@ -184,10 +184,10 @@ if ! service_running mysqld; then
     esac
   fi
 
-  start_service 'mysqld'
+  start_service 'mysql'
 
   # If we both installed and started, ensure it starts at boot
-  [ $NEW_MYSQL_INSTALL -eq 1 ] && chkconfig mysqld on
+  [ $NEW_MYSQL_INSTALL -eq 1 ] && chkconfig mysql on
 fi
 
 
@@ -300,7 +300,7 @@ if [ "$MODE" = 'init' ]; then
     db_sync='db_sync'
   fi
   # Run as $APP user so any newly created (log) files have correct ownership
-  runuser -s /bin/sh $APP -c "$APP-manage $db_sync"
+  su -s /bin/sh -c "$APP-manage $db_sync" openstack-$APP
 
   # Do a final sanity check on the database.
   if ! echo "SELECT * FROM migrate_version;" |
openSUSE Build Service is sponsored by