debian: add systemd service file (#16801)
This commit is contained in:
parent
4d7874a5bf
commit
c298a8728a
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
|
@ -5,4 +5,4 @@
|
|||
#export DH_VERBOSE=1
|
||||
|
||||
%:
|
||||
dh $@ --with python2
|
||||
dh $@ --with python2,systemd
|
||||
|
|
Reference in New Issue