debian: add systemd service file (#16800)

This commit is contained in:
Frédéric Péters 2017-06-10 11:53:51 +02:00
parent f04cb9ac70
commit 631a59403c
2 changed files with 27 additions and 0 deletions

View File

@ -1,3 +1,4 @@
debian/welco-manage /usr/bin
debian/settings.py /etc/welco
debian/debian_config.py /usr/lib/welco
debian/welco.service /lib/systemd/system

26
debian/welco.service vendored Normal file
View File

@ -0,0 +1,26 @@
[Unit]
Description=Welco
After=network.target postgresql.service
Wants=postgresql.service
[Service]
Environment=WELCO_SETTINGS_FILE=/usr/lib/%p/debian_config.py
User=%p
Group=%p
ExecStartPre=/usr/bin/welco-manage migrate_schemas --noinput
ExecStartPre=/usr/bin/welco-manage collectstatic --noinput
ExecStart=/usr/bin/gunicorn \
--bind unix:/run/%p/%p.sock \
--worker-class=sync \
--workers 5 \
--timeout=30 \
--name %p \
%p.wsgi:application
ExecReload=/bin/kill -HUP $MAINPID
TimeoutStartSec=0
PrivateTmp=true
Restart=on-failure
RuntimeDirectory=welco
[Install]
WantedBy=multi-user.target