summaryrefslogtreecommitdiff
path: root/support-files/mariadb@.service.in
diff options
context:
space:
mode:
authorJulius Goryavsky <julius.goryavsky@mariadb.com>2020-03-31 14:18:06 +0200
committerJulius Goryavsky <julius.goryavsky@mariadb.com>2020-04-08 13:02:09 +0200
commitc8e0c524af83149e77c88e9a6fd763221dea9277 (patch)
treeaad18be836a66103d809504a0a1e751b538dc1c1 /support-files/mariadb@.service.in
parent5720db2b43491e5aec9265bce9637e00c72fa0aa (diff)
downloadmariadb-git-c8e0c524af83149e77c88e9a6fd763221dea9277.tar.gz
MDEV-20676: systemd script not working
When trying to start mariadb via systemctl, WSREP failed to start mysqld for wsrep recovery, because the binary "galera-recovery" is neither searching the mysqld in the same folder as the binary itself nor in the path variable but instead expects the root to be /usr/local/mysql. This fix changes the current directory to the desired directory before starting mysqld.
Diffstat (limited to 'support-files/mariadb@.service.in')
-rw-r--r--support-files/mariadb@.service.in4
1 files changed, 2 insertions, 2 deletions
diff --git a/support-files/mariadb@.service.in b/support-files/mariadb@.service.in
index 475f3830a78..7b8c2b72cc0 100644
--- a/support-files/mariadb@.service.in
+++ b/support-files/mariadb@.service.in
@@ -76,14 +76,14 @@ PermissionsStartOnly=true
ExecStartPre=/bin/sh -c "systemctl unset-environment _WSREP_START_POSITION%I"
ExecStartPre=/bin/sh -c "[ ! -e @bindir@/galera_recovery ] && VAR= || \
- VAR=`@bindir@/galera_recovery --defaults-file=@sysconf2dir@/my%I.cnf`; [ $? -eq 0 ] \
+ VAR=`cd @bindir@/..; @bindir@/galera_recovery --defaults-file=@sysconf2dir@/my%I.cnf`; [ $? -eq 0 ] \
&& systemctl set-environment _WSREP_START_POSITION%I=$VAR || exit 1"
# Alternate: (remove ConditionPathExists above)
# use [mysqld.INSTANCENAME] as sections in my.cnf
#
#ExecStartPre=/bin/sh -c "[ ! -e @bindir@/galera_recovery ] && VAR= || \
-# VAR=`@bindir@/galera_recovery --defaults-group-suffix=%I`; [ $? -eq 0 ] \
+# VAR=`cd @bindir@/..; @bindir@/galera_recovery --defaults-group-suffix=%I`; [ $? -eq 0 ] \
# && systemctl set-environment _WSREP_START_POSITION%I=$VAR || exit 1"
# Needed to create system tables etc.