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

parent 7e3123c6
...@@ -150,13 +150,13 @@ context = ...@@ -150,13 +150,13 @@ context =
[mariadb-resiliency-after-import-script] [mariadb-resiliency-after-import-script]
recipe = slapos.recipe.build:download recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/template/instance-mariadb-resiliency-after-import-script.sh.in url = ${:_profile_base_location_}/template/instance-mariadb-resiliency-after-import-script.sh.in
md5sum = 5a300e69a5984cd0e4f5fe91c0c54aac md5sum = ea8ce40667827b16dbc642a73aca89f8
mode = 755 mode = 755
[template-mariadb] [template-mariadb]
recipe = slapos.recipe.build:download recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/instance-mariadb.cfg.in url = ${:_profile_base_location_}/instance-mariadb.cfg.in
md5sum = f8da9d6bb5da207d3ecadf2bba499616 md5sum = a5f9888bd882331c35d48f05e468a0a2
mode = 640 mode = 640
[template-zope] [template-zope]
......
...@@ -209,7 +209,7 @@ recipe = collective.recipe.template ...@@ -209,7 +209,7 @@ recipe = collective.recipe.template
input = {{ mariadb_resiliency_after_import_script }} input = {{ mariadb_resiliency_after_import_script }}
output = ${rootdirectory:srv}/runner-import-restore output = ${rootdirectory:srv}/runner-import-restore
mode = 755 mode = 755
dash_location = {{ dash_location }} dash = {{ dash_location }}/bin/dash
[rootdirectory] [rootdirectory]
recipe = slapos.cookbook:mkdirectory recipe = slapos.cookbook:mkdirectory
......
#!{{ dash_location }} #!${:dash}
# DO NOT RUN THIS SCRIPT ON PRODUCTION INSTANCE # DO NOT RUN THIS SCRIPT ON PRODUCTION INSTANCE
# OR MYSQL DATA WILL BE ERASED. # OR MYSQL DATA WILL BE ERASED.
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
# Depending on the output, it will create a file containing # Depending on the output, it will create a file containing
# the status of the restoration (success or failure) # the status of the restoration (success or failure)
set -e
mysql_executable="${mariadb-instance:mysql-binary}" mysql_executable="${mariadb-instance:mysql-binary}"
mysqldump_executable="${binary-wrap-mysqldump:wrapper-path}" mysqldump_executable="${binary-wrap-mysqldump:wrapper-path}"
mariadb_data_directory="${directory:mariadb-data}" mariadb_data_directory="${directory:mariadb-data}"
...@@ -28,7 +30,7 @@ if [ -e "$pid_file" ]; then ...@@ -28,7 +30,7 @@ if [ -e "$pid_file" ]; then
fi fi
echo "Deleting existing database..." 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..." echo "Adapting binlog database to new paths..."
new_binlog_directory="$(dirname $binlog_path)" 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