summaryrefslogtreecommitdiffstats
path: root/debian
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@entrouvert.com>2017-06-10 09:53:51 (GMT)
committerFrédéric Péters <fpeters@entrouvert.com>2017-06-18 08:36:30 (GMT)
commit631a59403c52e1b2b05a09fcc4108ca6da1dde48 (patch)
tree982ddf86bf6e5f485272a190a8bfb39d32790162 /debian
parentf04cb9ac709c55709d2d5f8d26d5b8a0462c8e12 (diff)
downloadwelco-631a59403c52e1b2b05a09fcc4108ca6da1dde48.zip
welco-631a59403c52e1b2b05a09fcc4108ca6da1dde48.tar.gz
welco-631a59403c52e1b2b05a09fcc4108ca6da1dde48.tar.bz2
debian: add systemd service file (#16800)
Diffstat (limited to 'debian')
-rw-r--r--debian/welco.install1
-rw-r--r--debian/welco.service26
2 files changed, 27 insertions, 0 deletions
diff --git a/debian/welco.install b/debian/welco.install
index e62f67f..d34622b 100644
--- a/debian/welco.install
+++ b/debian/welco.install
@@ -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
diff --git a/debian/welco.service b/debian/welco.service
new file mode 100644
index 0000000..e4ae3ca
--- /dev/null
+++ b/debian/welco.service
@@ -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