diff options
author | Julius Goryavsky <julius.goryavsky@mariadb.com> | 2020-03-31 14:18:06 +0200 |
---|---|---|
committer | Julius Goryavsky <julius.goryavsky@mariadb.com> | 2020-03-31 14:18:06 +0200 |
commit | cbf00b625a831a306fcfa450b76f580d962c75db (patch) | |
tree | 89eed0251f00642b51d0bf4ccd2f10b62a7e6e96 | |
parent | f9639c2d1a5e24f1a1533b6277fe7eca3aa3c3c0 (diff) | |
download | mariadb-git-10.1-MDEV-20676.tar.gz |
MDEV-20676: systemd script not working10.1-MDEV-20676
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.
-rw-r--r-- | support-files/mariadb.service.in | 2 | ||||
-rw-r--r-- | support-files/mariadb@.service.in | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/support-files/mariadb.service.in b/support-files/mariadb.service.in index 38f55cb7e8f..1cc37dcc3e6 100644 --- a/support-files/mariadb.service.in +++ b/support-files/mariadb.service.in @@ -70,7 +70,7 @@ PermissionsStartOnly=true # Do not panic if galera_recovery script is not available. (MDEV-10538) ExecStartPre=/bin/sh -c "systemctl unset-environment _WSREP_START_POSITION" ExecStartPre=/bin/sh -c "[ ! -e @bindir@/galera_recovery ] && VAR= || \ - VAR=`@bindir@/galera_recovery`; [ $? -eq 0 ] \ + VAR=`cd @bindir@/..; @bindir@/galera_recovery`; [ $? -eq 0 ] \ && systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1" # Needed to create system tables etc. 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. |