diff --git a/scripts/upgrade b/scripts/upgrade index 0c85b96..2f0ef2a 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -39,6 +39,14 @@ then ynh_die --message="Sorry, this version is not upgradable to the latest version :(" fi +#================================================= +# STOP SYSTEMD SERVICE +#================================================= +ynh_script_progression --message="Stopping a systemd service..." --weight=1 + +# Stop bservice before backup, to not loose message in case of failed upgrade and restore +ynh_systemd_action --service_name=$app --action="stop" --log_path=systemd --line_match="Stopped" + #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= @@ -56,13 +64,6 @@ ynh_abort_if_errors #================================================= # STANDARD UPGRADE STEPS -#================================================= -# STOP SYSTEMD SERVICE -#================================================= -ynh_script_progression --message="Stopping a systemd service..." --weight=1 - -ynh_systemd_action --service_name=$app --action="stop" --log_path=systemd --line_match="Stopped" - #================================================= # ENSURE DOWNWARD COMPATIBILITY #=================================================