mirror of
https://github.com/MariaDB/server.git
synced 2026-05-16 20:07:13 +02:00
MDEV-10538: MariaDB fails to start without galera_recovery in systemd mode
Update ExecStartPre scripts to not fail if 'galera_recovery' script is not available.
This commit is contained in:
parent
d0d99dec91
commit
294961cc4d
2 changed files with 13 additions and 8 deletions
|
|
@ -63,9 +63,11 @@ PermissionsStartOnly=true
|
|||
# galera_recovery simply returns an empty string. In any case, however,
|
||||
# the script is not expected to return with a non-zero status.
|
||||
# It is always safe to unset _WSREP_START_POSITION environment variable.
|
||||
# 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 "VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ] && \
|
||||
systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1"
|
||||
ExecStartPre=/bin/sh -c "[ ! -e /usr/bin/galera_recovery ] && VAR= || \
|
||||
VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ] \
|
||||
&& systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1"
|
||||
|
||||
# Needed to create system tables etc.
|
||||
# ExecStartPre=/usr/bin/mysql_install_db -u mysql
|
||||
|
|
|
|||
|
|
@ -70,16 +70,19 @@ PermissionsStartOnly=true
|
|||
# galera_recovery simply returns an empty string. In any case, however,
|
||||
# the script is not expected to return with a non-zero status.
|
||||
# It is always safe to unset _WSREP_START_POSITION%I environment variable.
|
||||
# Do not panic if galera_recovery script is not available. (MDEV-10538)
|
||||
ExecStartPre=/bin/sh -c "systemctl unset-environment _WSREP_START_POSITION%I"
|
||||
ExecStartPre=/bin/sh -c "VAR=`/usr/bin/galera_recovery \
|
||||
--defaults-file=@INSTALL_SYSCONF2DIR@/my%I.cnf`; [ $? -eq 0 ] && \
|
||||
systemctl set-environment _WSREP_START_POSITION%I=$VAR || exit 1"
|
||||
|
||||
ExecStartPre=/bin/sh -c "[ ! -e /usr/bin/galera_recovery ] && VAR= || \
|
||||
VAR=`/usr/bin/galera_recovery --defaults-file=@INSTALL_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 "VAR=`/usr/bin/galera_recovery \
|
||||
# --defaults-group-suffix=%I`; [ $? -eq 0 ] && \
|
||||
# systemctl set-environment _WSREP_START_POSITION%I=$VAR || exit 1"
|
||||
#ExecStartPre=/bin/sh -c "[ ! -e /usr/bin/galera_recovery ] && VAR= || \
|
||||
# VAR=`/usr/bin/galera_recovery --defaults-group-suffix=%I`; [ $? -eq 0 ] \
|
||||
# && systemctl set-environment _WSREP_START_POSITION%I=$VAR || exit 1"
|
||||
|
||||
# Needed to create system tables etc.
|
||||
# ExecStartPre=/usr/bin/mysql_install_db -u mysql
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue