fixup! erp5: mariadb import script: kill mysqld process in trap.

parent 7e3123c6
......@@ -150,13 +150,13 @@ context =
[mariadb-resiliency-after-import-script]
recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/template/instance-mariadb-resiliency-after-import-script.sh.in
md5sum = 5a300e69a5984cd0e4f5fe91c0c54aac
md5sum = ea8ce40667827b16dbc642a73aca89f8
mode = 755
[template-mariadb]
recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/instance-mariadb.cfg.in
md5sum = f8da9d6bb5da207d3ecadf2bba499616
md5sum = a5f9888bd882331c35d48f05e468a0a2
mode = 640
[template-zope]
......
......@@ -209,7 +209,7 @@ recipe = collective.recipe.template
input = {{ mariadb_resiliency_after_import_script }}
output = ${rootdirectory:srv}/runner-import-restore
mode = 755
dash_location = {{ dash_location }}
dash = {{ dash_location }}/bin/dash
[rootdirectory]
recipe = slapos.cookbook:mkdirectory
......
#!{{ dash_location }}
#!${:dash}
# DO NOT RUN THIS SCRIPT ON PRODUCTION INSTANCE
# OR MYSQL DATA WILL BE ERASED.
......@@ -10,6 +10,8 @@
# Depending on the output, it will create a file containing
# the status of the restoration (success or failure)
set -e
mysql_executable="${mariadb-instance:mysql-binary}"
mysqldump_executable="${binary-wrap-mysqldump:wrapper-path}"
mariadb_data_directory="${directory:mariadb-data}"
......@@ -28,7 +30,7 @@ if [ -e "$pid_file" ]; then
fi
echo "Deleting existing database..."
rm -r $mariadb_data_directory/*
rm -r $mariadb_data_directory/* >/dev/null 2>&1 || true
echo "Adapting binlog database to new paths..."
new_binlog_directory="$(dirname $binlog_path)"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment