From d04aba1b4cbf7d55d474566c1c33ea274014ab09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Mon, 7 Dec 2020 16:26:21 +0100 Subject: [PATCH] Update uwsgi helper --- scripts/experimental_helper.sh | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/scripts/experimental_helper.sh b/scripts/experimental_helper.sh index 35cd123..dc680bf 100644 --- a/scripts/experimental_helper.sh +++ b/scripts/experimental_helper.sh @@ -8,19 +8,22 @@ ynh_check_global_uwsgi_config () { [Unit] Description=%i uWSGI app After=syslog.target + [Service] RuntimeDirectory=%i ExecStart=/usr/bin/uwsgi \ --ini /etc/uwsgi/apps-available/%i.ini \ - --socket /var/run/%i/app.socket \ + --socket /run/%i/app.socket \ --logto /var/log/uwsgi/%i/%i.log User=%i Group=www-data -Restart=on-failure +Restart=always +RestartSec=10 KillSignal=SIGQUIT Type=notify StandardError=syslog NotifyAccess=all + [Install] WantedBy=multi-user.target EOF @@ -45,10 +48,14 @@ EOF # # To be able to customise the settings of the systemd unit you can override the rules with the file "conf/uwsgi-app@override.service". # This file will be automatically placed on the good place +# +# Note that the service need to be started manually at the end of the installation. +# Generally you can start the service with this command: +# # ynh_systemd_action --service_name "uwsgi-app@$app.service" --line_match "WSGI app 0 \(mountpoint='[/[:alnum:]_-]*'\) ready in [[:digit:]]* seconds on interpreter" --log_path "/var/log/uwsgi/$app/$app.log" # # usage: ynh_add_uwsgi_service # -# to interact with your service: `systemctl uwsgi-app@app` +# to interact with your service: `systemctl uwsgi-app@$app` ynh_add_uwsgi_service () { ynh_check_global_uwsgi_config @@ -96,9 +103,7 @@ ynh_add_uwsgi_service () { cp ../conf/uwsgi-app@override.service /etc/systemd/system/uwsgi-app@$app.service.d/override.conf systemctl daemon-reload - systemctl stop "uwsgi-app@$app.service" || true systemctl enable "uwsgi-app@$app.service" - systemctl start "uwsgi-app@$app.service" # Add as a service yunohost service add "uwsgi-app@$app" --log "/var/log/uwsgi/$app/$app.log"