From 7ee369e034801356efcd72e1eb8900bc32f11a51 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 24 Dec 2020 20:04:35 +0100 Subject: [PATCH 1/4] You probably don't need to call 'ynh_normalize_url_path'... --- scripts/upgrade | 7 ------- 1 file changed, 7 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 4a1070e..5eace1c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -69,13 +69,6 @@ ynh_clean_setup () { # Exit if an error occurs during the execution of the script ynh_abort_if_errors -#================================================= -# CHECK THE PATH -#================================================= - -# Normalize the URL path syntax -path_url=$(ynh_normalize_url_path --path_url=$path_url) - #================================================= # STANDARD UPGRADE STEPS #================================================= From d30ceda76df7b7970e81e069033a5592b5795c08 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 24 Dec 2020 20:05:30 +0100 Subject: [PATCH 2/4] Please add --quiet to systemctl enable/disable commands --- scripts/restore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/restore b/scripts/restore index 6907a74..24d40ff 100644 --- a/scripts/restore +++ b/scripts/restore @@ -106,7 +106,7 @@ ynh_mongo_restore_db --database="$db_name" < ./dump.bson ynh_script_progression --message="Restoring the systemd configuration..." ynh_restore_file --origin_path="/etc/systemd/system/$app.service" -systemctl enable $app.service +systemctl enable $app.service --quiet #================================================= # INTEGRATE SERVICE IN YUNOHOST From 7b8aacd32310b58716c4d5f94aa96e83b429dfc9 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 24 Dec 2020 20:07:02 +0100 Subject: [PATCH 3/4] Using option '--log_type systemd' with 'yunohost service add' is not relevant anymore --- scripts/install | 2 +- scripts/restore | 2 +- scripts/upgrade | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/install b/scripts/install index 36dcb3c..15248aa 100644 --- a/scripts/install +++ b/scripts/install @@ -152,7 +152,7 @@ find "$final_path" -type d -print0 | xargs -0 chmod 750 #================================================= ynh_script_progression --message="Integrating service in YunoHost..." -yunohost service add $app --description "Wekan daemon" --log_type "systemd" +yunohost service add $app --description "Wekan daemon" yunohost service add $mongodb_servicename --description "MongoDB daemon" --log "/var/log/mongodb/mongodb.log" #================================================= diff --git a/scripts/restore b/scripts/restore index 24d40ff..bbc8ced 100644 --- a/scripts/restore +++ b/scripts/restore @@ -113,7 +113,7 @@ systemctl enable $app.service --quiet #================================================= ynh_script_progression --message="Integrating service in YunoHost..." -yunohost service add $app --description "Wekan daemon" --log_type "systemd" +yunohost service add $app --description "Wekan daemon" #================================================= # START SYSTEMD SERVICE diff --git a/scripts/upgrade b/scripts/upgrade index 5eace1c..4765c35 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -91,7 +91,7 @@ fi if ynh_version_gt "0.45-3" "${previous_version}" ; then ynh_script_progression --message="Upgrading to 0.45-3..." - yunohost service add $app --description "Wekan daemon" --log_type "systemd" + yunohost service add $app --description "Wekan daemon" fi if ynh_version_gt "1.07~ynh2" "${previous_version}" ; then @@ -102,7 +102,7 @@ if ynh_version_gt "1.07~ynh2" "${previous_version}" ; then rm -f /etc/apt/sources.list.d/mongodb-org-3.2.list ynh_remove_app_dependencies ynh_install_app_dependencies "mongodb mongodb-server" - yunohost service add $app --description "Wekan daemon" --log_type "systemd" + yunohost service add $app --description "Wekan daemon" fi if ynh_version_gt "2.56~ynh1" "${previous_version}" ; then From aa0a57c39211185deae842957d25551f9afffa10 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 24 Dec 2020 20:09:32 +0100 Subject: [PATCH 4/4] Found some inconsistencies in the 'yunohost service add' commands between install, upgrade and restore: --- scripts/install | 1 - scripts/upgrade | 9 +++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index 15248aa..af00f9f 100644 --- a/scripts/install +++ b/scripts/install @@ -153,7 +153,6 @@ find "$final_path" -type d -print0 | xargs -0 chmod 750 ynh_script_progression --message="Integrating service in YunoHost..." yunohost service add $app --description "Wekan daemon" -yunohost service add $mongodb_servicename --description "MongoDB daemon" --log "/var/log/mongodb/mongodb.log" #================================================= # START SYSTEMD SERVICE diff --git a/scripts/upgrade b/scripts/upgrade index 4765c35..b59fd6c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -91,7 +91,6 @@ fi if ynh_version_gt "0.45-3" "${previous_version}" ; then ynh_script_progression --message="Upgrading to 0.45-3..." - yunohost service add $app --description "Wekan daemon" fi if ynh_version_gt "1.07~ynh2" "${previous_version}" ; then @@ -102,7 +101,6 @@ if ynh_version_gt "1.07~ynh2" "${previous_version}" ; then rm -f /etc/apt/sources.list.d/mongodb-org-3.2.list ynh_remove_app_dependencies ynh_install_app_dependencies "mongodb mongodb-server" - yunohost service add $app --description "Wekan daemon" fi if ynh_version_gt "2.56~ynh1" "${previous_version}" ; then @@ -212,6 +210,13 @@ chown -R $app: "$final_path" chmod -R 640 "$final_path" find "$final_path" -type d -print0 | xargs -0 chmod 750 +#================================================= +# INTEGRATE SERVICE IN YUNOHOST +#================================================= +ynh_script_progression --message="Integrating service in YunoHost..." + +yunohost service add $app --description "Wekan daemon" + #================================================= # START SYSTEMD SERVICE #=================================================