1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/mastodon_ynh.git synced 2024-09-03 19:46:02 +02:00

Stop services before moving databases around

This commit is contained in:
Salamandar 2024-05-27 14:19:32 +02:00
parent cac945ae6d
commit 4130f8af25

View file

@ -14,7 +14,21 @@ upgrade_type=$(ynh_check_app_version_changed)
config="$install_dir/live/.env.production"
#=================================================
# STANDARD UPGRADE STEPS
# STOP SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Stopping a systemd service..." --weight=1
if ynh_compare_current_package_version --comparison lt --version "4.2.8~ynh2"; then
# Workaround for pre-packagingv2 versions
ynh_systemd_action --service_name=${app}-web --action="stop" --log_path="systemd" --line_match="Goodbye"
ynh_systemd_action --service_name=${app}-sidekiq --action="stop" --log_path="systemd" --line_match="Bye"
ynh_systemd_action --service_name=${app}-streaming --action="stop" --log_path="systemd"
else
ynh_systemd_action --service_name=${app}-web --action="stop" --log_path=/var/log/$app/$app-web.log --line_match="Goodbye"
ynh_systemd_action --service_name=${app}-sidekiq --action="stop" --log_path=/var/log/$app/$app-sidekiq.log --line_match="Bye"
ynh_systemd_action --service_name=${app}-streaming --action="stop" --log_path=/var/log/$app/$app-streaming.log
fi
#=================================================
# ENSURE DOWNWARD COMPATIBILITY
#=================================================
@ -49,22 +63,6 @@ if ynh_compare_current_package_version --comparison lt --version "4.2.8~ynh2"; t
fi
fi
#=================================================
# STOP SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Stopping a systemd service..." --weight=1
if ynh_compare_current_package_version --comparison lt --version "4.2.8~ynh2"; then
# Workaround for pre-packagingv2 versions
ynh_systemd_action --service_name=${app}-web --action="stop" --log_path="systemd" --line_match="Goodbye"
ynh_systemd_action --service_name=${app}-sidekiq --action="stop" --log_path="systemd" --line_match="Bye"
ynh_systemd_action --service_name=${app}-streaming --action="stop" --log_path="systemd"
else
ynh_systemd_action --service_name=${app}-web --action="stop" --log_path=/var/log/$app/$app-web.log --line_match="Goodbye"
ynh_systemd_action --service_name=${app}-sidekiq --action="stop" --log_path=/var/log/$app/$app-sidekiq.log --line_match="Bye"
ynh_systemd_action --service_name=${app}-streaming --action="stop" --log_path=/var/log/$app/$app-streaming.log
fi
#=================================================
# ADD SWAP IF NEEDED
#=================================================