Skip to content
Snippets Groups Projects
Commit de898f52 authored by Andrey Postnikov's avatar Andrey Postnikov
Browse files

DB: mariadb no restart

parent 29754c42
No related branches found
No related tags found
No related merge requests found
Pipeline #180440 passed
#!/bin/bash
terminate() {
echo "Caught termination signal, shutting down..."
if [ -n "${PID}" ]; then
kill -TERM "${PID}"
wait "${PID}"
fi
echo "Shutdown complete."
exit 0
}
trap terminate SIGTERM SIGINT
if [ ! -f /var/lib/mysql/ibdata1 ];
then
echo "rebuilding /var/lib/mysql/ibdata1"
......@@ -12,10 +24,12 @@ if [ ! -f /var/lib/mysql/ibdata1 ];
mysql -e "CREATE USER 'drupaltestbot'@'%' IDENTIFIED BY 'drupaltestbotpw';"
mysql -e "GRANT ALL PRIVILEGES ON *.* TO 'drupaltestbot'@'%' WITH GRANT OPTION; SELECT User FROM mysql.user; FLUSH PRIVILEGES;"
echo "Grants added"
killall mysqld
wait ${PID}
fi
/usr/bin/mysqld_safe;
echo "mysql died at $(date)";
# Start MySQL server if container restart and data is ready
if [ -z "${PID}" ]; then
/usr/bin/mysqld_safe &
PID="${!}"
fi
wait ${PID}
echo "mysql exited at $(date)";
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment