summaryrefslogtreecommitdiff
path: root/salt/openbook/database/files/start_galera_node.sh
diff options
context:
space:
mode:
Diffstat (limited to 'salt/openbook/database/files/start_galera_node.sh')
-rw-r--r--salt/openbook/database/files/start_galera_node.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/salt/openbook/database/files/start_galera_node.sh b/salt/openbook/database/files/start_galera_node.sh
new file mode 100644
index 0000000..29b7e55
--- /dev/null
+++ b/salt/openbook/database/files/start_galera_node.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+# the mysql database files will be missing if this is the first startup after a fresh install
+if [ ! -d "{{ pillar["database"]["dirs"]["var_lib_mysql"]["name"] }}/mysql" ]; then
+ export DEBIAN_FRONTEND=noninteractive
+ . /etc/profile
+ debconf-set-selections /etc/mysql/conf.d/debconfrc
+ dpkg-reconfigure mariadb-server-10.1
+fi
+
+/etc/mysql/bin/fix_permissions.sh &
+exec /usr/sbin/mysqld ${@}