diff --git a/conf/invidious.timer b/conf/systemd.timer similarity index 100% rename from conf/invidious.timer rename to conf/systemd.timer diff --git a/scripts/install b/scripts/install index cecdec4..6c4935a 100644 --- a/scripts/install +++ b/scripts/install @@ -138,14 +138,6 @@ ynh_script_progression --message="Modifying a config file..." ynh_add_config --template="../conf/config.yml" --destination="$final_path/config/config.yml" chmod 600 $final_path/config/config.yml -#================================================= -# SETUP SYSTEMD -#================================================= -ynh_script_progression --message="Configuring a systemd service..." --weight=1 - -ynh_add_config --template="../conf/invidious.timer" --destination="/etc/systemd/system/$app.timer" -ynh_add_systemd_config - #================================================= # SETUP CRON #================================================= @@ -169,6 +161,15 @@ ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 yunohost service add $app --description="Invidious is an alternative front-end to YouTube" --log="/var/log/$app/$app.log" +#================================================= +# CONFIGURE SYSTEMD TIMER +#================================================= +ynh_script_progression --message="Configuring a timer service..." --weight=1 + +ynh_add_config --template="../conf/systemd.timer" --destination="/etc/systemd/system/$app.timer" +systemctl enable $app.timer --quiet +systemctl start $app.timer + #================================================= # START SYSTEMD SERVICE #================================================= @@ -176,8 +177,6 @@ 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 -systemctl enable $app.timer -systemctl start $app.timer #================================================= # SETUP SSOWAT @@ -201,4 +200,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Installation of Invidious completed" --last +ynh_script_progression --message="Installation of $app completed" --last diff --git a/scripts/remove b/scripts/remove index 1dc5874..69fb67d 100644 --- a/scripts/remove +++ b/scripts/remove @@ -42,6 +42,8 @@ ynh_script_progression --message="Stopping and removing the systemd service..." # Remove the dedicated systemd config ynh_remove_systemd_config +# Remove the dedicated timer systemd config +ynh_secure_remove --file="/etc/systemd/system/$app.timer" #================================================= # REMOVE THE POSTGRESQL DATABASE @@ -69,12 +71,6 @@ ynh_script_progression --message="Removing Invidious main directory..." --weight # Remove the app directory securely ynh_secure_remove --file="$final_path" -#================================================= -# REMOVE SYSTEMD TIMER -#================================================= - -ynh_secure_remove --file="/etc/systemd/system/$app.timer" - #================================================= # REMOVE NGINX CONFIGURATION #================================================= diff --git a/scripts/restore b/scripts/restore index 73f43dc..275b617 100644 --- a/scripts/restore +++ b/scripts/restore @@ -100,9 +100,12 @@ 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/$app.timer" systemctl enable $app.service --quiet +ynh_restore_file --origin_path="/etc/systemd/system/$app.timer" +systemctl enable $app.timer --quiet +systemctl start $app.timer + #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= @@ -116,8 +119,6 @@ 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 -systemctl enable $app.timer -systemctl start $app.timer #================================================= # RESTORE VARIOUS FILES diff --git a/scripts/upgrade b/scripts/upgrade index fbff334..d0f4785 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -132,10 +132,13 @@ ynh_add_nginx_config #================================================= ynh_script_progression --message="Configuring a systemd service..." --weight=2 -# Create a dedicated systemd config -ynh_add_config --template="../conf/invidious.timer" --destination="/etc/systemd/system/$app.timer" ynh_add_systemd_config +# Create a dedicated timer systemd config +ynh_add_config --template="../conf/systemd.timer" --destination="/etc/systemd/system/$app.timer" +systemctl enable $app.timer --quiet +systemctl start $app.timer + #================================================= # GENERIC FINALIZATION #================================================= @@ -159,8 +162,6 @@ 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 -systemctl enable $app.timer -systemctl start $app.timer #================================================= # RELOAD NGINX