debian: add systemd service file (#16320)

This commit is contained in:
Frédéric Péters 2017-05-14 17:21:57 +02:00
parent 0596918f9b
commit 8818a38827
2 changed files with 26 additions and 1 deletions

View File

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

24
debian/chrono.service vendored Normal file
View File

@ -0,0 +1,24 @@
[Unit]
Description=Chrono
After=network.target postgresql.service
Wants=postgresql.service
[Service]
Environment=CHRONO_SETTINGS_FILE=/usr/lib/%p/debian_config.py
User=%p
Group=%p
ExecStartPre=/usr/bin/chrono-manage migrate_schemas --noinput
ExecStartPre=/usr/bin/chrono-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
PrivateTmp=true
Restart=on-failure
[Install]
WantedBy=multi-user.target