From 4a44539d1d91951f029f6c8fc65ca99b725d8cec Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 4 Jun 2020 16:51:14 +0200 Subject: [PATCH 1/3] Service integration homogenization --- scripts/install | 3 ++- scripts/remove | 2 +- scripts/restore | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 05c1b71..0a52780 100755 --- a/scripts/install +++ b/scripts/install @@ -290,13 +290,14 @@ ynh_use_logrotate #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= +ynh_script_progression --message="Integrating service in YunoHost..." --time --weight=1 ### `yunohost service add` integrates a service in YunoHost. It then gets ### displayed in the admin interface and through the others `yunohost service` commands. ### (N.B. : this line only makes sense if the app adds a service to the system!) ### If you're not using these lines: ### - You can remove these files in conf/. -### - Remove the section "REMOVE SERVICE FROM ADMIN PANEL" in the remove script +### - Remove the section "REMOVE SERVICE INTEGRATION IN YUNOHOST" in the remove script ### - As well as the section "INTEGRATE SERVICE IN YUNOHOST" in the restore script yunohost service add $app --description "A short description of the app" --log "/var/log/$app/$app.log" diff --git a/scripts/remove b/scripts/remove index 9d27c8b..bb5566b 100755 --- a/scripts/remove +++ b/scripts/remove @@ -31,7 +31,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) # 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 >/dev/null then - ynh_script_progression --message="Removing $app service..." --time --weight=1 + ynh_script_progression --message="Removing $app service integration..." --time --weight=1 yunohost service remove $app fi diff --git a/scripts/restore b/scripts/restore index 323afa0..0487f95 100755 --- a/scripts/restore +++ b/scripts/restore @@ -120,6 +120,7 @@ systemctl enable $app.service #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= +ynh_script_progression --message="Integrating service in YunoHost..." --time --weight=1 yunohost service add $app --description "A short description of the app" --log "/var/log/$app/$app.log" From 67437ba64dcbc4a5e0261b4b92311f67d357c08f Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 4 Jun 2020 16:52:38 +0200 Subject: [PATCH 2/3] Adding service integration step during upgrade --- scripts/install | 1 + scripts/upgrade | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/scripts/install b/scripts/install index 0a52780..d70aa7d 100755 --- a/scripts/install +++ b/scripts/install @@ -299,6 +299,7 @@ ynh_script_progression --message="Integrating service in YunoHost..." --time --w ### - You can remove these files in conf/. ### - Remove the section "REMOVE SERVICE INTEGRATION IN YUNOHOST" in the remove script ### - As well as the section "INTEGRATE SERVICE IN YUNOHOST" in the restore script +### - And the section "INTEGRATE SERVICE IN YUNOHOST" in the upgrade script yunohost service add $app --description "A short description of the app" --log "/var/log/$app/$app.log" diff --git a/scripts/upgrade b/scripts/upgrade index e7de87b..59204f6 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -204,6 +204,13 @@ then ynh_app_setting_set --app=$app --key=unprotected_uris --value="/" fi +#================================================= +# INTEGRATE SERVICE IN YUNOHOST +#================================================= +ynh_script_progression --message="Integrating service in YunoHost..." --time --weight=1 + +yunohost service add $app --description "A short description of the app" --log "/var/log/$app/$app.log" + #================================================= # START SYSTEMD SERVICE #================================================= From d2f32be8ed23958519824501b686408b658a5074 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Tue, 16 Jun 2020 23:07:13 +0200 Subject: [PATCH 3/3] Update upgrade --- scripts/upgrade | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index ac38a6f..2076e33 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -184,6 +184,13 @@ ynh_script_progression --message="Upgrading logrotate configuration..." --time - # Use logrotate to manage app-specific logfile(s) ynh_use_logrotate --non-append +#================================================= +# INTEGRATE SERVICE IN YUNOHOST +#================================================= +ynh_script_progression --message="Integrating service in YunoHost..." --time --weight=1 + +yunohost service add $app --description "A short description of the app" --log "/var/log/$app/$app.log" + #================================================= # START SYSTEMD SERVICE #================================================= @@ -211,20 +218,6 @@ then ynh_app_setting_set --app=$app --key=unprotected_uris --value="/" fi -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --time --weight=1 - -yunohost service add $app --description "A short description of the app" --log "/var/log/$app/$app.log" - -#================================================= -# START SYSTEMD SERVICE -#================================================= -ynh_script_progression --message="Starting a systemd service..." --time --weight=1 - -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" - #================================================= # RELOAD NGINX #=================================================