1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/civicrm_drupal7_ynh.git synced 2024-09-03 18:16:19 +02:00

Implement mysql hook

This commit is contained in:
yalh76 2022-01-05 01:05:48 +01:00
parent c5739d6f85
commit de59ef7c17
6 changed files with 44 additions and 6 deletions

View file

@ -0,0 +1,31 @@
#!/bin/bash
source /usr/share/yunohost/helpers
force=${2:-0} # 0/1 --force argument
dryrun=${3:-0} # 0/1 --dry-run argument
pending_conf=$4 # Path of the pending conf file
do_pre_regen() {
ynh_replace_string --match_string="thread_stack = 128K" --replace_string="thread_stack = 192K" --target_file="${pending_conf}/../mysql/etc/mysql/my.cnf"
}
do_post_regen() {
regen_conf_files=$1
}
case "$1" in
pre)
do_pre_regen
;;
post)
do_post_regen
;;
*)
echo "Hook called with unknown argument \`$1'" >&2
exit 1
;;
esac
exit 0

View file

@ -63,6 +63,8 @@ ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
ynh_backup --src_path="/etc/cron.d/$app"
ynh_backup --src_path="/usr/share/yunohost/hooks/conf_regen/34-mysql_$app"
#=================================================
# BACKUP THE MYSQL DATABASE
#=================================================

View file

@ -120,9 +120,8 @@ ynh_add_fpm_config --usage=low --footprint=low
#=================================================
ynh_script_progression --message="Upgrading thread_stack..."
ynh_replace_string --match_string="thread_stack = 128K" --replace_string="thread_stack = 192K" --target_file="/etc/mysql/my.cnf"
ynh_systemd_action --service_name=mysql --action="restart"
cp -R ../conf/mysql_hook_regen_conf /usr/share/yunohost/hooks/conf_regen/34-mysql_$app
yunohost tools regen-conf mysql --force
#=================================================
# CREATE DRUSH ALIAS

View file

@ -73,6 +73,10 @@ ynh_script_progression --message="Removing various files..."
# Remove a cron file
ynh_secure_remove --file="/etc/cron.d/$app"
# Remove MySQL Hook
ynh_secure_remove --file="/usr/share/yunohost/hooks/conf_regen/34-mysql_$app"
yunohost tools regen-conf mysql --force
#=================================================
# GENERIC FINALIZATION
#=================================================

View file

@ -102,6 +102,9 @@ ynh_script_progression --message="Restoring various files..."
ynh_restore_file --origin_path="/etc/cron.d/$app"
ynh_restore_file --origin_path="/usr/share/yunohost/hooks/conf_regen/34-mysql_$app"
yunohost tools regen-conf mysql --force
#=================================================
# GENERIC FINALIZATION
#=================================================

View file

@ -114,9 +114,8 @@ ynh_add_fpm_config --usage=low --footprint=low
#=================================================
ynh_script_progression --message="Upgrading thread_stack..."
ynh_replace_string --match_string="thread_stack = 128K" --replace_string="thread_stack = 192K" --target_file="/etc/mysql/my.cnf"
ynh_systemd_action --service_name=mysql --action="restart"
cp -R ../conf/mysql_hook_regen_conf /usr/share/yunohost/hooks/conf_regen/34-mysql_$app
yunohost tools regen-conf mysql --force
#=================================================
# SETUP THE CRON FILE