From 64c1293c1c26da68484e2d8b35c3d1c42b83392e Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 2 Jan 2021 20:14:02 +0100 Subject: [PATCH 1/3] Please add --quiet to systemctl enable/disable commands to avoid unecessary warnings when the script runs --- scripts/restore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/restore b/scripts/restore index 26195e7..a0a1a34 100644 --- a/scripts/restore +++ b/scripts/restore @@ -129,7 +129,7 @@ ynh_psql_execute_file_as_root --file="./db.sql" --database=$db_name 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 bd5364a1c99f6be76c44a6219b8ad745bc8f232c Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 2 Jan 2021 20:17:30 +0100 Subject: [PATCH 2/3] Found some inconsistencies in the 'yunohost service add' commands between install, upgrade and restore --- scripts/upgrade | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index c16f112..ca83245 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -228,14 +228,6 @@ pushd "$final_path" sudo -u $app env $ynh_node_load_PATH yarn install --production --pure-lockfile popd -#================================================= -# SETUP LOGROTATE -#================================================= -ynh_script_progression --message="Upgrading logrotate configuration..." - -# Use logrotate to manage app-specific logfile(s) -ynh_use_logrotate --non-append - #================================================= # SETUP SYSTEMD #================================================= @@ -254,6 +246,28 @@ ynh_script_progression --message="Securing files and directories..." # Set permissions on app files chown -R $app:$app $final_path +#================================================= +# SETUP LOGROTATE +#================================================= +ynh_script_progression --message="Upgrading logrotate configuration..." + +# 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..." + +yunohost service add $appyunohost service add $app --description "$app daemon for Peertube" --log "$datadir/logs/peertube.log" + +#================================================= +# START SYSTEMD SERVICE +#================================================= +ynh_script_progression --message="Starting a systemd service..." + +ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Server listening on localhost" + #================================================= # SETUP SSOWAT #================================================= @@ -266,13 +280,6 @@ then ynh_app_setting_set --app=$app --key=unprotected_uris --value="/" fi -#================================================= -# START SYSTEMD SERVICE -#================================================= -ynh_script_progression --message="Starting a systemd service..." - -ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Server listening on localhost" - #================================================= # RELOAD NGINX #================================================= From f3f948e317995add6c5c9ee66fd693fbf9752193 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Tue, 5 Jan 2021 21:16:54 +0100 Subject: [PATCH 3/3] Fix upgrade --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index ca83245..878c18b 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -259,7 +259,7 @@ ynh_use_logrotate --non-append #================================================= ynh_script_progression --message="Integrating service in YunoHost..." -yunohost service add $appyunohost service add $app --description "$app daemon for Peertube" --log "$datadir/logs/peertube.log" +yunohost service add $app --description "$app daemon for Peertube" --log "$datadir/logs/peertube.log" #================================================= # START SYSTEMD SERVICE