debian: add systemd service file (#16801)

This commit is contained in:
Frédéric Péters 2017-06-10 11:56:53 +02:00
parent 4d7874a5bf
commit c298a8728a
4 changed files with 29 additions and 2 deletions

2
debian/control vendored
View File

@ -2,7 +2,7 @@ Source: corbo
Maintainer: Serghei Mihai <smihai@entrouvert.com>
Section: python
Priority: optional
Build-Depends: python-setuptools (>= 0.6b3), python-all (>= 2.6.6-3), debhelper (>= 7.4.3),
Build-Depends: python-setuptools (>= 0.6b3), python-all (>= 2.6.6-3), debhelper (>= 7.4.3), dh-systemd,
python-django
Standards-Version: 3.9.1

View File

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

26
debian/corbo.service vendored Normal file
View File

@ -0,0 +1,26 @@
[Unit]
Description=Corbo
After=network.target postgresql.service
Wants=postgresql.service
[Service]
Environment=CORBO_SETTINGS_FILE=/usr/lib/%p/debian_config.py
User=%p
Group=%p
ExecStartPre=/usr/bin/corbo-manage migrate_schemas --noinput
ExecStartPre=/usr/bin/corbo-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=corbo
[Install]
WantedBy=multi-user.target

2
debian/rules vendored
View File

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