From 631a59403c52e1b2b05a09fcc4108ca6da1dde48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Sat, 10 Jun 2017 11:53:51 +0200 Subject: [PATCH] debian: add systemd service file (#16800) --- debian/welco.install | 1 + debian/welco.service | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 debian/welco.service 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