added gunicorn role
This commit is contained in:
parent
40abdfca64
commit
f1d32f86b7
3 changed files with 69 additions and 0 deletions
16
roles/gunicorn/files/gunicorn.service
Normal file
16
roles/gunicorn/files/gunicorn.service
Normal file
|
@ -0,0 +1,16 @@
|
|||
[Unit]
|
||||
Description=Gunicorn Service
|
||||
After=nss-user-lookup-target
|
||||
|
||||
[Service]
|
||||
PIDFile=/run/gunicorn/%i.pid
|
||||
User=%i
|
||||
Group=%i
|
||||
ExecStart=/usr/bin/gunicorn --pid /run/gunicorn/%i.pid \
|
||||
--bind unix:/run/gunicorn/%i.sock %i
|
||||
ExecReload=/bin/kill -s HUP $MAINPID
|
||||
ExecStop=/bin/kill -s TERM $MAINPID
|
||||
PrivateTmp=true
|
||||
|
||||
[Install]
|
||||
Also=gunicorn@%i.socket
|
11
roles/gunicorn/files/gunicorn.socket
Normal file
11
roles/gunicorn/files/gunicorn.socket
Normal file
|
@ -0,0 +1,11 @@
|
|||
[Unit]
|
||||
Description=Gunicorn Socket
|
||||
|
||||
[Socket]
|
||||
ListenStream=/run/gunicorn/gunicorn-%i.sock
|
||||
RuntimeDirectory=gunicorn
|
||||
SocketUser=%i
|
||||
SocketMode=0660
|
||||
|
||||
[Install]
|
||||
WantedBy=sockets.target
|
Loading…
Add table
Add a link
Reference in a new issue