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:
parent
2cbdd5e01f
commit
d04aba1b4c
1 changed files with 10 additions and 5 deletions
|
@ -8,19 +8,22 @@ ynh_check_global_uwsgi_config () {
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=%i uWSGI app
|
Description=%i uWSGI app
|
||||||
After=syslog.target
|
After=syslog.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
RuntimeDirectory=%i
|
RuntimeDirectory=%i
|
||||||
ExecStart=/usr/bin/uwsgi \
|
ExecStart=/usr/bin/uwsgi \
|
||||||
--ini /etc/uwsgi/apps-available/%i.ini \
|
--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
|
--logto /var/log/uwsgi/%i/%i.log
|
||||||
User=%i
|
User=%i
|
||||||
Group=www-data
|
Group=www-data
|
||||||
Restart=on-failure
|
Restart=always
|
||||||
|
RestartSec=10
|
||||||
KillSignal=SIGQUIT
|
KillSignal=SIGQUIT
|
||||||
Type=notify
|
Type=notify
|
||||||
StandardError=syslog
|
StandardError=syslog
|
||||||
NotifyAccess=all
|
NotifyAccess=all
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
EOF
|
EOF
|
||||||
|
@ -46,9 +49,13 @@ 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".
|
# 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
|
# 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
|
# 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_add_uwsgi_service () {
|
||||||
ynh_check_global_uwsgi_config
|
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
|
cp ../conf/uwsgi-app@override.service /etc/systemd/system/uwsgi-app@$app.service.d/override.conf
|
||||||
|
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
systemctl stop "uwsgi-app@$app.service" || true
|
|
||||||
systemctl enable "uwsgi-app@$app.service"
|
systemctl enable "uwsgi-app@$app.service"
|
||||||
systemctl start "uwsgi-app@$app.service"
|
|
||||||
|
|
||||||
# Add as a service
|
# Add as a service
|
||||||
yunohost service add "uwsgi-app@$app" --log "/var/log/uwsgi/$app/$app.log"
|
yunohost service add "uwsgi-app@$app" --log "/var/log/uwsgi/$app/$app.log"
|
||||||
|
|
Loading…
Add table
Reference in a new issue