From 1be8c6e4a62863ba3a311294869cbb5f149f1ce5 Mon Sep 17 00:00:00 2001 From: Krakinou Date: Wed, 30 Jan 2019 00:05:19 +0100 Subject: [PATCH] stop app before upgrade --- scripts/upgrade | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 6ba7e9d..a5f4ee1 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -44,6 +44,9 @@ ynh_clean_setup () { # Exit if an error occurs during the execution of the script ynh_abort_if_errors +#Stop the app in case database is updated +ynh_systemd_action -a stop + #================================================= # CHECK THE PATH #================================================= @@ -99,8 +102,11 @@ ynh_multimedia_addaccess $app ynh_backup_if_checksum_is_different "$final_path/app.db" #set database settings as per conf file : restart server so that app.db is regenerated, then add new ldap settings -ynh_systemd_action -a stop ynh_systemd_action -l "INFO in server: Starting Gevent server" +#sleep required on low spec like raspberryPi +sleep 2s +ynh_systemd_action -a stop + conf="\"UPDATE settings SET $(. <(echo -E echo $(<../conf/init_calibre_db_ldap_settings))) WHERE ID=1\"" eval sqlite3 $final_path/app.db "$conf"