add OpenUDS Broker gunicorn executor as systemd unit

This commit is contained in:
Алексей Шабалин 2020-12-03 22:15:45 +03:00
parent 0a1aaa7cfe
commit 4b7e636ea8
2 changed files with 30 additions and 0 deletions

20
.gear/openuds-web.service Normal file
View File

@ -0,0 +1,20 @@
[Unit]
Description=OpenUDS Broker Web server daemon
Requires=openuds-web.socket
After=network.target
[Service]
PIDFile=/run/openuds/pid
User=openuds
Group=openuds
RuntimeDirectory=openuds
WorkingDirectory=/usr/share/openuds
ExecStart=/usr/bin/gunicorn --pid /run/openuds/pid \
--bind unix:/run/openuds/socket server.wsgi \
--workers 5 --threads 8
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s TERM $MAINPID
PrivateTmp=true
[Install]
WantedBy=multi-user.target

10
.gear/openuds-web.socket Normal file
View File

@ -0,0 +1,10 @@
[Unit]
Description=OpenUDS Broker Web server socket
[Socket]
ListenStream=/run/openuds/socket
SocketUser=openuds
SocketGroup=_webserver
[Install]
WantedBy=sockets.target