1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/ffsync_ynh.git synced 2024-09-03 18:26:38 +02:00

Update uwsgi helper

This commit is contained in:
Josué Tille 2020-12-07 16:26:21 +01:00
parent 2cbdd5e01f
commit d04aba1b4c
No known key found for this signature in database
GPG key ID: 716A6C99B04194EF

View file

@ -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 <action> uwsgi-app@app`
# to interact with your service: `systemctl <action> 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"