debian: add systemd unit file

This commit is contained in:
Frédéric Péters 2019-02-22 15:04:20 +01:00
parent 1b02acc3c8
commit 87602c0ca3
3 changed files with 26 additions and 1 deletions

1
debian/control vendored
View File

@ -3,6 +3,7 @@ Section: python
Priority: optional
Maintainer: Benjamin Dauvergne <bdauvergne@entrouvert.com>
Build-Depends: debhelper (>= 9),
dh-systemd,
python-setuptools,
python-all,
python-django

2
debian/rules vendored
View File

@ -5,4 +5,4 @@
#export DH_VERBOSE=1
%:
dh $@ --with python2
dh $@ --with python2,systemd

24
debian/zoo.service vendored Normal file
View File

@ -0,0 +1,24 @@
[Unit]
Description=Zoo
After=network.target syslog.target postgresql.service
Wants=postgresql.service
[Service]
Environment=ZOO_SETTINGS_FILE=/usr/lib/%p/debian_config.py
Environment=LANG=C.UTF-8
User=%p
Group=%p
ExecStartPre=/usr/bin/zoo-manage migrate_schemas --noinput
ExecStartPre=/usr/bin/zoo-manage collectstatic --noinput
ExecStart=/usr/bin/uwsgi --ini /etc/%p/uwsgi.ini
ExecReload=/bin/kill -HUP $MAINPID
KillSignal=SIGQUIT
PrivateTmp=true
Restart=on-failure
RuntimeDirectory=zoo
Type=notify
StandardError=syslog
NotifyAccess=all
[Install]
WantedBy=multi-user.target