erp5 mariadb resiliency import script: make sure the script does not run forever.

parent bd10da56
...@@ -150,7 +150,7 @@ context = ...@@ -150,7 +150,7 @@ 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 = ea8ce40667827b16dbc642a73aca89f8 md5sum = 06882a0620e3b976c0fa212dc16fd9cf
mode = 755 mode = 755
[template-mariadb] [template-mariadb]
......
...@@ -46,9 +46,17 @@ trap "kill $mysqld_pid" EXIT TERM INT ...@@ -46,9 +46,17 @@ trap "kill $mysqld_pid" EXIT TERM INT
sleep 30 sleep 30
# If mysql has stopped, abort # If mysql has stopped, abort
if ! [ -d /proc/$mysql_pid ]; then if ! [ -d /proc/$mysql_pid ]; then
echo "mysqld exited, aborting."
exit 1
fi
$instance_directory/etc/run/mariadb_update &
mariadb_update_pid=$!
sleep 60
# If mariadb_update is still running, abort
if [ -d /proc/$mariadb_update_pid ]; then
echo "mariadb_update still running after timeout, aborting."
exit 1 exit 1
fi fi
$instance_directory/etc/run/mariadb_update
echo "Importing data..." echo "Importing data..."
# Use latest dump XXX can contain funny characters # Use latest dump XXX can contain funny characters
......
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