mirror of
https://github.com/YunoHost-Apps/funkwhale_ynh.git
synced 2024-09-03 18:36:24 +02:00
Implementing ynh_systemd_action
This commit is contained in:
parent
10c7da29fc
commit
3101a0480c
5 changed files with 22 additions and 15 deletions
|
@ -28,7 +28,6 @@ final_path=$(ynh_app_setting_get "$app" final_path)
|
||||||
domain=$(ynh_app_setting_get "$app" domain)
|
domain=$(ynh_app_setting_get "$app" domain)
|
||||||
db_name=$(ynh_app_setting_get "$app" db_name)
|
db_name=$(ynh_app_setting_get "$app" db_name)
|
||||||
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD BACKUP STEPS
|
# STANDARD BACKUP STEPS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -200,8 +200,6 @@ ynh_add_systemd_config "$app-server" "funkwhale-server.service"
|
||||||
ynh_add_systemd_config "$app-worker" "funkwhale-worker.service"
|
ynh_add_systemd_config "$app-worker" "funkwhale-worker.service"
|
||||||
ynh_add_systemd_config "$app-beat" "funkwhale-beat.service"
|
ynh_add_systemd_config "$app-beat" "funkwhale-beat.service"
|
||||||
|
|
||||||
systemctl restart "$app".target
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALIZATION
|
# GENERIC FINALIZATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -220,7 +218,6 @@ chown -R "$app": "/var/log/$app"
|
||||||
|
|
||||||
ynh_add_fail2ban_config "/var/log/nginx/$domain-access.log" "<HOST>.* \"POST /api/v1/token/ HTTP/1.1\" 400 68.*$" 5
|
ynh_add_fail2ban_config "/var/log/nginx/$domain-access.log" "<HOST>.* \"POST /api/v1/token/ HTTP/1.1\" 400 68.*$" 5
|
||||||
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# ADVERTISE SERVICE IN ADMIN PANEL
|
# ADVERTISE SERVICE IN ADMIN PANEL
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -253,7 +250,9 @@ systemctl reload nginx
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info "Start Services..."
|
ynh_print_info "Start Services..."
|
||||||
|
|
||||||
systemctl start "$app-server" "$app-worker" "$app-beat"
|
ynh_systemd_action --action=start --service_name=${app}-beat --log_path=systemd --line_match="celery beat process"
|
||||||
|
ynh_systemd_action --action=start --service_name=${app}-server --log_path=systemd --line_match="Listening on TCP address"
|
||||||
|
ynh_systemd_action --action=start --service_name=${app}-worker --log_path=systemd --line_match="celery worker"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
|
|
|
@ -53,7 +53,9 @@ fi
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info "Stopping and removing the systemd service"
|
ynh_print_info "Stopping and removing the systemd service"
|
||||||
|
|
||||||
systemctl stop "$app".target
|
ynh_systemd_action --action=stop --service_name=${app}-beat --log_path=systemd --line_match="Stopped Funkwhale"
|
||||||
|
ynh_systemd_action --action=stop --service_name=${app}-server --log_path=systemd --line_match="Stopped Funkwhale"
|
||||||
|
ynh_systemd_action --action=stop --service_name=${app}-worker --log_path=systemd --line_match="Stopped Funkwhale"
|
||||||
|
|
||||||
# Remove the dedicated systemd config
|
# Remove the dedicated systemd config
|
||||||
ynh_remove_systemd_config "$app-server"
|
ynh_remove_systemd_config "$app-server"
|
||||||
|
|
|
@ -130,7 +130,6 @@ ynh_restore_file "/etc/systemd/system/$app.target"
|
||||||
systemctl enable "$app-beat.service"
|
systemctl enable "$app-beat.service"
|
||||||
systemctl enable "$app-server.service"
|
systemctl enable "$app-server.service"
|
||||||
systemctl enable "$app-worker.service"
|
systemctl enable "$app-worker.service"
|
||||||
systemctl restart "$app.target"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# ADVERTISE SERVICE IN ADMIN PANEL
|
# ADVERTISE SERVICE IN ADMIN PANEL
|
||||||
|
@ -147,9 +146,17 @@ yunohost service add "$app-beat" --log "/var/log/$app/beat.log"
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info "Reloading nginx web server..."
|
ynh_print_info "Reloading nginx web server..."
|
||||||
|
|
||||||
|
|
||||||
systemctl reload nginx
|
systemctl reload nginx
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# START SERVICES
|
||||||
|
#=================================================
|
||||||
|
ynh_print_info "Start Services..."
|
||||||
|
|
||||||
|
ynh_systemd_action --action=start --service_name=${app}-beat --log_path=systemd --line_match="celery beat process"
|
||||||
|
ynh_systemd_action --action=start --service_name=${app}-server --log_path=systemd --line_match="Listening on TCP address"
|
||||||
|
ynh_systemd_action --action=start --service_name=${app}-worker --log_path=systemd --line_match="celery worker"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -74,9 +74,9 @@ ynh_abort_if_errors
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info "Stopping $app services..."
|
ynh_print_info "Stopping $app services..."
|
||||||
|
|
||||||
systemctl stop "$app-beat.service"
|
ynh_systemd_action --action=stop --service_name=${app}-beat --log_path=systemd --line_match="Stopped Funkwhale"
|
||||||
systemctl stop "$app-server.service"
|
ynh_systemd_action --action=stop --service_name=${app}-server --log_path=systemd --line_match="Stopped Funkwhale"
|
||||||
systemctl stop "$app-worker.service"
|
ynh_systemd_action --action=stop --service_name=${app}-worker --log_path=systemd --line_match="Stopped Funkwhale"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CHECK THE PATH
|
# CHECK THE PATH
|
||||||
|
@ -238,8 +238,6 @@ ynh_add_systemd_config "$app-server" "funkwhale-server.service"
|
||||||
ynh_add_systemd_config "$app-worker" "funkwhale-worker.service"
|
ynh_add_systemd_config "$app-worker" "funkwhale-worker.service"
|
||||||
ynh_add_systemd_config "$app-beat" "funkwhale-beat.service"
|
ynh_add_systemd_config "$app-beat" "funkwhale-beat.service"
|
||||||
|
|
||||||
systemctl restart "$app".target
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALIZATION
|
# GENERIC FINALIZATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -286,9 +284,11 @@ ynh_app_setting_set "$app" code_migration 2
|
||||||
#=================================================
|
#=================================================
|
||||||
# START SERVICES
|
# START SERVICES
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info "Starting $app services..."
|
ynh_print_info "Start Services..."
|
||||||
|
|
||||||
systemctl restart "$app.target"
|
ynh_systemd_action --action=start --service_name=${app}-beat --log_path=systemd --line_match="celery beat process"
|
||||||
|
ynh_systemd_action --action=start --service_name=${app}-server --log_path=systemd --line_match="Listening on TCP address"
|
||||||
|
ynh_systemd_action --action=start --service_name=${app}-worker --log_path=systemd --line_match="celery worker"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
|
|
Loading…
Reference in a new issue