From db87f8622c049e61af40826db6bab89fd8c3acf9917fe29b49d9cc4e4407f99a Mon Sep 17 00:00:00 2001
From: Danilo Spinella <danilo.spinella@suse.com>
Date: Wed, 31 Aug 2022 15:10:09 +0000
Subject: [PATCH] Accepting request 1000486 from
 home:dspinella:branches:server:database

- Update mysql-systemd-helper to be aware of custom group, bsc#1200105
- Respect socket setting in mysql-systemd-helper
- Fix my_print_defaults call in mysql-system-helper

OBS-URL: https://build.opensuse.org/request/show/1000486
OBS-URL: https://build.opensuse.org/package/show/server:database/mariadb?expand=0&rev=299
---
 mariadb.changes      | 7 +++++++
 mysql-systemd-helper | 6 ++++--
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/mariadb.changes b/mariadb.changes
index 22a48b5..f31ca75 100644
--- a/mariadb.changes
+++ b/mariadb.changes
@@ -1,3 +1,10 @@
+-------------------------------------------------------------------
+Wed Aug 31 15:06:37 UTC 2022 - Danilo Spinella <danilo.spinella@suse.com>
+
+- Update mysql-systemd-helper to be aware of custom group, bsc#1200105
+- Respect socket setting in mysql-systemd-helper
+- Fix my_print_defaults call in mysql-system-helper
+
 -------------------------------------------------------------------
 Tue Aug  2 23:36:11 UTC 2022 - chris@computersalat.de
 
diff --git a/mysql-systemd-helper b/mysql-systemd-helper
index 2859307..b1aeace 100644
--- a/mysql-systemd-helper
+++ b/mysql-systemd-helper
@@ -23,7 +23,7 @@ read_config() {
 
 	# Read options - important for multi setup
 	if [[ -n "$INSTANCE" ]]; then
-		opts="$(/usr/bin/my_print_defaults mysqld mysqld_multi "$INSTANCE" --defaults-extra-file=/etc/my${INSTANCE}.cnf)"
+		opts="$(/usr/bin/my_print_defaults --defaults-extra-file=/etc/my${INSTANCE}.cnf mysqld mysqld_multi "$INSTANCE")"
 		tmp_opts="$opts"
 		config="/etc/my${INSTANCE}.cnf"
 	else
@@ -39,6 +39,7 @@ read_config() {
 			--socket=*)    socket="$(echo "$arg"             | sed -e 's/^[^=]*=//')" ;;
 			--datadir=*)   datadir="$(echo "$arg"            | sed -e 's/^[^=]*=//')" ;;
 			--user=*)      mysql_daemon_user="$(echo "$arg"  | sed -e 's/^[^=]*=//')" ;;
+			--group=*)      mysql_daemon_group="$(echo "$arg"  | sed -e 's/^[^=]*=//')" ;;
 		esac
 	done
 
@@ -171,7 +172,8 @@ mysql_start() {
 	exec /usr/sbin/mysqld \
 		--defaults-file="$config" \
 		$ignore_db_dir \
-		--user="$mysql_daemon_user"
+		--user="$mysql_daemon_user" \
+		--socket="$socket"
 }
 
 # We rely on output in english at some points