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:
parent
cac945ae6d
commit
4130f8af25
1 changed files with 15 additions and 17 deletions
|
@ -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
|
||||
#=================================================
|
||||
|
|
Loading…
Reference in a new issue