From 1fb4e50974aa60edfbc5a70bb74985349077b755 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 22 Jun 2021 10:21:13 +0200 Subject: [PATCH] Fix --- scripts/change_url | 6 ++++-- scripts/install | 3 ++- scripts/remove | 2 +- scripts/restore | 3 ++- scripts/upgrade | 7 +++---- 5 files changed, 12 insertions(+), 9 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index cf19a29..0dedd78 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -74,7 +74,8 @@ fi #================================================= ynh_script_progression --message="Stopping a systemd service..." --weight=1 -ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name=$app --action="stop" --log_path=systemd +ynh_systemd_action --service_name=$app.timer --action="stop" --log_path=systemd #================================================= # MODIFY URL IN NGINX CONF @@ -112,7 +113,8 @@ fi #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=3 -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name=$app --action="start" --log_path=systemd +ynh_systemd_action --service_name=$app.timer --action=start --log_path=systemd #================================================= # RELOAD NGINX diff --git a/scripts/install b/scripts/install index c479af7..cfaa608 100644 --- a/scripts/install +++ b/scripts/install @@ -145,7 +145,7 @@ ynh_script_progression --message="Configuring a systemd service..." --weight=1 ynh_add_systemd_config -ynh_add_config --template="../conf/invidious.timer" --destination="/etc/systemd/system/invidious.timer" +ynh_add_config --template="../conf/invidious.timer" --destination="/etc/systemd/system/$app.timer" #================================================= # SETUP CRON @@ -177,6 +177,7 @@ ynh_script_progression --message="Starting a systemd service..." --weight=2 # Start a systemd service ynh_systemd_action --service_name=$app --action=start --log_path=systemd +ynh_systemd_action --service_name=$app.timer --action=start --log_path=systemd #================================================= # SETUP SSOWAT diff --git a/scripts/remove b/scripts/remove index 076edc8..1dc5874 100644 --- a/scripts/remove +++ b/scripts/remove @@ -73,7 +73,7 @@ ynh_secure_remove --file="$final_path" # REMOVE SYSTEMD TIMER #================================================= -ynh_secure_remove --file="/etc/systemd/system/invidious.timer" +ynh_secure_remove --file="/etc/systemd/system/$app.timer" #================================================= # REMOVE NGINX CONFIGURATION diff --git a/scripts/restore b/scripts/restore index c3bb0f5..1bc9309 100644 --- a/scripts/restore +++ b/scripts/restore @@ -100,7 +100,7 @@ ynh_psql_execute_file_as_root --file="./db.sql" --database=$db_name ynh_script_progression --message="Restoring the systemd configuration..." --weight=5 ynh_restore_file --origin_path="/etc/systemd/system/$app.service" -ynh_restore_file --origin_path="/etc/systemd/system/invidious.timer" +ynh_restore_file --origin_path="/etc/systemd/system/$app.timer" systemctl enable $app.service --quiet #================================================= @@ -116,6 +116,7 @@ yunohost service add $app --description="Invidious is an alternative front-end t ynh_script_progression --message="Starting a systemd service..." --weight=1 ynh_systemd_action --service_name=$app --action=start --log_path=systemd +ynh_systemd_action --service_name=$app.timer --action=start --log_path=systemd #================================================= # RESTORE VARIOUS FILES diff --git a/scripts/upgrade b/scripts/upgrade index f4abc49..03b3221 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -74,6 +74,7 @@ ynh_abort_if_errors ynh_script_progression --message="Stopping a systemd service..." --weight=1 ynh_systemd_action --service_name=$app --action=stop --log_path=systemd +ynh_systemd_action --service_name=$app.timer --action="stop" --log_path=systemd #================================================= # UPGRADE DEPENDENCIES @@ -99,9 +100,6 @@ then # Backup the config file in the temp dir cp -a "$final_path/config/config.yml" "$tmpdir/config.yml" - # Remove the app directory securely - #ynh_secure_remove --file=$final_path - #git clone https://github.com/iv-org/invidious "$final_path" --quiet pushd $final_path git pull @@ -136,7 +134,7 @@ ynh_script_progression --message="Configuring a systemd service..." --weight=2 # Create a dedicated systemd config ynh_add_systemd_config -ynh_add_config --template="../conf/invidious.timer" --destination="/etc/systemd/system/invidious.timer" +ynh_add_config --template="../conf/invidious.timer" --destination="/etc/systemd/system/$app.timer" #================================================= # GENERIC FINALIZATION @@ -161,6 +159,7 @@ yunohost service add $app --description="Invidious is an alternative front-end t ynh_script_progression --message="Starting a systemd service..." --weight=1 ynh_systemd_action --service_name=$app --action=restart --log_path=systemd +ynh_systemd_action --service_name=$app.timer --action=start --log_path=systemd #================================================= # RELOAD NGINX