From 0d6d2cc424cb7ad4e2f7881aeb64506b21f11f6e Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 27 Feb 2019 18:22:55 +0100 Subject: [PATCH] add ynh_systemd_action --- scripts/install | 4 ++-- scripts/remove | 3 ++- scripts/restore | 4 ++-- scripts/upgrade | 4 ++-- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/scripts/install b/scripts/install index e1210ca..f6ff792 100644 --- a/scripts/install +++ b/scripts/install @@ -7,6 +7,7 @@ #================================================= source _common.sh +source ynh_systemd_action source /usr/share/yunohost/helpers #================================================= @@ -243,8 +244,7 @@ systemctl reload nginx #================================================= ynh_print_info "Reloading OnlyOffice..." -supervisorctl stop all -supervisorctl start all +ynh_systemd_action --service_name=supervisor --action=restart --line_match="INFO success: docservice entered RUNNING state" --log_path="systemd" #================================================= # END OF SCRIPT diff --git a/scripts/remove b/scripts/remove index 3485d9c..54afadd 100644 --- a/scripts/remove +++ b/scripts/remove @@ -7,6 +7,7 @@ #================================================= source _common.sh +source ynh_systemd_action source /usr/share/yunohost/helpers #================================================= @@ -28,7 +29,7 @@ final_path=$(ynh_app_setting_get $app final_path) #================================================= ynh_print_info "Stopping OnlyOffice" -supervisorctl stop all +ynh_systemd_action --service_name=supervisor --action=stop --log_path="systemd" #================================================= # REMOVE THE POSTGRESQL DATABASE diff --git a/scripts/restore b/scripts/restore index 46931f0..e584af3 100644 --- a/scripts/restore +++ b/scripts/restore @@ -7,6 +7,7 @@ #================================================= source ../settings/scripts/_common.sh +source ../settings/scripts/ynh_systemd_action source /usr/share/yunohost/helpers #================================================= @@ -130,8 +131,7 @@ systemctl reload nginx #================================================= ynh_print_info "Reloading OnlyOffice..." -supervisorctl stop all -supervisorctl start all +ynh_systemd_action --service_name=supervisor --action=restart --line_match="INFO success: docservice entered RUNNING state" --log_path="systemd" #================================================= # END OF SCRIPT diff --git a/scripts/upgrade b/scripts/upgrade index 2a0a4d9..5ea385d 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -7,6 +7,7 @@ #================================================= source _common.sh +source ynh_systemd_action source /usr/share/yunohost/helpers #================================================= @@ -146,8 +147,7 @@ systemctl reload nginx #================================================= ynh_print_info "Reloading OnlyOffice..." -supervisorctl stop all -supervisorctl start all +ynh_systemd_action --service_name=supervisor --action=restart --line_match="INFO success: docservice entered RUNNING state" --log_path="systemd" #================================================= # END OF SCRIPT