summaryrefslogtreecommitdiff
path: root/support-files
diff options
context:
space:
mode:
authorNirbhay Choubey <nirbhay@mariadb.com>2016-08-22 18:38:06 -0400
committerNirbhay Choubey <nirbhay@mariadb.com>2016-08-22 18:38:06 -0400
commit294961cc4d4d55730e807b3f0a7f93a3dd4d4f7b (patch)
tree0c0d2c0c94ca3d373424fc9e4c6b41318a38806e /support-files
parentd0d99dec914d409d7889fcec2efd126edad10bde (diff)
downloadmariadb-git-294961cc4d4d55730e807b3f0a7f93a3dd4d4f7b.tar.gz
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.
Diffstat (limited to 'support-files')
-rw-r--r--support-files/mariadb.service.in6
-rw-r--r--support-files/mariadb@.service.in15
2 files changed, 13 insertions, 8 deletions
diff --git a/support-files/mariadb.service.in b/support-files/mariadb.service.in
index 6b8b2ba0ba3..9b97172e1b5 100644
--- a/support-files/mariadb.service.in
+++ b/support-files/mariadb.service.in
@@ -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
diff --git a/support-files/mariadb@.service.in b/support-files/mariadb@.service.in
index 965e85260e4..e941f21526e 100644
--- a/support-files/mariadb@.service.in
+++ b/support-files/mariadb@.service.in
@@ -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