From 616a1d064d6b0a8b68bebe00311201e4e3e2a6db Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sun, 24 May 2020 00:35:56 +0200 Subject: [PATCH] Fix #111 --- check_process | 6 +++++- scripts/install | 2 +- scripts/remove | 4 ++-- scripts/restore | 2 +- scripts/upgrade | 5 +++++ 5 files changed, 14 insertions(+), 5 deletions(-) diff --git a/check_process b/check_process index 4607f16c..63182dee 100644 --- a/check_process +++ b/check_process @@ -18,6 +18,8 @@ upgrade=1 from_commit=10c3703567d1e9504ea4f298778464c7dd561470 # 0.10.9~ynh1 upgrade=1 from_commit=8c5e710060da43a946336d66a30b9c311cfdbc37 + # 0.10.9~ynh2 + upgrade=1 from_commit=c81ed6b760a1a68b8993917e808434166766a37a backup_restore=1 multi_instance=1 # This test is no longer necessary since the version 2.7 (PR: https://github.com/YunoHost/yunohost/pull/304), you can still do it if your app could be installed with this version. @@ -34,4 +36,6 @@ Notification=all ; commit=10c3703567d1e9504ea4f298778464c7dd561470 name=0.10.8 ; commit=8c5e710060da43a946336d66a30b9c311cfdbc37 - name=0.10.9~ynh1 \ No newline at end of file + name=0.10.9~ynh1 + ; commit=c81ed6b760a1a68b8993917e808434166766a37a + name=0.10.9~ynh2 diff --git a/scripts/install b/scripts/install index 6afa9e81..7d78a72e 100644 --- a/scripts/install +++ b/scripts/install @@ -230,7 +230,7 @@ ynh_use_logrotate --logfile="/var/log/$app/${app}-horizon.log" #================================================= ynh_print_info --message="Integrating service in YunoHost..." -yunohost service add "supervisor" --description "${app}-horizon daemon for $app" --log "/var/log/$app/${app}-horizon.log" +yunohost service add "supervisor" --description "Supervisor daemon for $app" --log "/var/log/$app/${app}-horizon.log" #================================================= # START SUPERVISOR SERVICE diff --git a/scripts/remove b/scripts/remove index bbe6783e..d558989f 100644 --- a/scripts/remove +++ b/scripts/remove @@ -34,8 +34,8 @@ ynh_print_info --message="Removing service integration in YunoHost..." # Remove the service from the list of services known by Yunohost (added from `yunohost service add`) if ynh_exec_warn_less yunohost service status ${app}-horizon >/dev/null then - ynh_print_info --message="Removing ${app}-horizon service..." - yunohost service remove "${app}-horizon" + ynh_print_info --message="Removing supervisor service..." + yunohost service remove "supervisor" fi #================================================= diff --git a/scripts/restore b/scripts/restore index ac7f329d..d6b5c4ca 100644 --- a/scripts/restore +++ b/scripts/restore @@ -139,7 +139,7 @@ supervisorctl reread && supervisorctl update #================================================= ynh_print_info --message="Integrating service in YunoHost..." -yunohost service add "supervisor" --log "/var/log/$app/${app}-horizon.log" +yunohost service add "supervisor" --description "Supervisor daemon for $app" --log "/var/log/$app/${app}-horizon.log" #================================================= # START SUPERVISOR SERVICE diff --git a/scripts/upgrade b/scripts/upgrade index 9e07e125..b6998aae 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -103,6 +103,11 @@ if dpkg --compare-versions "0.10.9~ynh2" gt "$(ynh_read_manifest --manifest="/et ynh_supervisor_action --service_name="${app}-horizon" --action="start" --log_path="/var/log/$app/${app}-horizon.log" fi +if dpkg --compare-versions "0.10.9~ynh3" gt "$(ynh_read_manifest --manifest="/etc/yunohost/apps/$YNH_APP_INSTANCE_NAME/manifest.json" --manifest_key="version" || echo 1.0)" ; then + yunohost service remove "${app}-horizon" + yunohost service add "supervisor" --description "Supervisor daemon for $app" --log "/var/log/$app/${app}-horizon.log" +fi + #================================================= # STANDARD UPGRADE STEPS #=================================================