From 37810a22a277ccb8fff8011bd47ad7a828c90d88 Mon Sep 17 00:00:00 2001 From: Maniack Crudelis Date: Thu, 24 Jan 2019 18:20:40 +0100 Subject: [PATCH 1/3] Fix #548 --- data/helpers.d/backend | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/data/helpers.d/backend b/data/helpers.d/backend index 26e53ede9..58bf65840 100644 --- a/data/helpers.d/backend +++ b/data/helpers.d/backend @@ -222,7 +222,12 @@ ynh_add_fpm_config () { if [ -e "../conf/php-fpm.ini" ] then - echo "Please do not use a separate ini file, merge you directives in the pool file instead." &>2 + echo "Please do not use a separate ini file, merge your directives in the pool file instead." >&2 + finalphpini="$fpm_config_dir/conf.d/20-$app.ini" + ynh_backup_if_checksum_is_different "$finalphpini" + sudo cp ../conf/php-fpm.ini "$finalphpini" + sudo chown root: "$finalphpini" + ynh_store_file_checksum "$finalphpini" fi sudo systemctl reload $fpm_service } From cd993ff06581c7600ca74eb0d865789650fb5548 Mon Sep 17 00:00:00 2001 From: Maniack Crudelis Date: Thu, 24 Jan 2019 18:32:52 +0100 Subject: [PATCH 2/3] Print backup and restore logs into the upgrade log Without --debug in upgrade command line, no more log will be printed in stdout. Still the log will be added to the log file, and so will help to debug a backup in that case. --- data/helpers.d/utils | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/helpers.d/utils b/data/helpers.d/utils index b280c3b21..43dabfcd4 100644 --- a/data/helpers.d/utils +++ b/data/helpers.d/utils @@ -48,7 +48,7 @@ ynh_restore_upgradebackup () { # Remove the application then restore it sudo yunohost app remove $app # Restore the backup - sudo yunohost backup restore $app_bck-pre-upgrade$backup_number --apps $app --force + sudo yunohost backup restore $app_bck-pre-upgrade$backup_number --apps $app --force --debug ynh_die "The app was restored to the way it was before the failed upgrade." fi else @@ -87,7 +87,7 @@ ynh_backup_before_upgrade () { fi # Create backup - sudo BACKUP_CORE_ONLY=1 yunohost backup create --apps $app --name $app_bck-pre-upgrade$backup_number + sudo BACKUP_CORE_ONLY=1 yunohost backup create --apps $app --name $app_bck-pre-upgrade$backup_number --debug if [ "$?" -eq 0 ] then # If the backup succeeded, remove the previous backup From e706daa9b9a94aa094b7f391b8452160eb30cf17 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Thu, 24 Jan 2019 18:33:35 +0100 Subject: [PATCH 3/3] Update data/helpers.d/backend Co-Authored-By: maniackcrudelis --- data/helpers.d/backend | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/helpers.d/backend b/data/helpers.d/backend index 58bf65840..e73644d2d 100644 --- a/data/helpers.d/backend +++ b/data/helpers.d/backend @@ -222,7 +222,7 @@ ynh_add_fpm_config () { if [ -e "../conf/php-fpm.ini" ] then - echo "Please do not use a separate ini file, merge your directives in the pool file instead." >&2 + echo "Packagers ! Please do not use a separate php ini file, merge your directives in the pool file instead." >&2 finalphpini="$fpm_config_dir/conf.d/20-$app.ini" ynh_backup_if_checksum_is_different "$finalphpini" sudo cp ../conf/php-fpm.ini "$finalphpini"