From 308953a51547a3a45a705d609e1682e22f345631 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Thu, 9 Jul 2020 09:58:16 +0200 Subject: [PATCH] debian: use shell script to load /etc/authentic2/authentic.conf in systemd service file (#44960) --- debian/authentic2-manage | 1 + debian/authentic2.install | 1 + debian/authentic2.service | 2 +- debian/launch-authentic2.sh | 15 +++++++++++++++ 4 files changed, 18 insertions(+), 1 deletion(-) create mode 100755 debian/launch-authentic2.sh diff --git a/debian/authentic2-manage b/debian/authentic2-manage index 1633f0fa7..ddc540893 100644 --- a/debian/authentic2-manage +++ b/debian/authentic2-manage @@ -24,6 +24,7 @@ fi if [ -f /etc/authentic2/db.conf ]; then . /etc/authentic2/db.conf fi + if [ -f /etc/authentic2/authentic.conf ]; then . /etc/authentic2/authentic.conf fi diff --git a/debian/authentic2.install b/debian/authentic2.install index 6a8d182d5..a608b2659 100644 --- a/debian/authentic2.install +++ b/debian/authentic2.install @@ -2,3 +2,4 @@ debian/conf/authentic.conf /etc/authentic2 debian/authentic2-manage /usr/bin debian/conf/nginx-example.conf /usr/share/authentic2 debian/debian_config.py /usr/lib/authentic2 +debian/launch-authentic2.sh /usr/lib/authentic2 diff --git a/debian/authentic2.service b/debian/authentic2.service index be697b0f4..c85309d7e 100644 --- a/debian/authentic2.service +++ b/debian/authentic2.service @@ -10,7 +10,7 @@ User=authentic2 Group=authentic2 ExecStartPre=/usr/bin/authentic2-manage migrate --noinput ExecStartPre=/usr/bin/authentic2-manage collectstatic --noinput -ExecStart=/usr/bin/gunicorn3 \ +ExecStart=/usr/lib/authentic2/launch-authentic2.sh \ --bind unix:/run/%p/%p.sock \ --worker-class=sync \ --workers 5 \ diff --git a/debian/launch-authentic2.sh b/debian/launch-authentic2.sh new file mode 100755 index 000000000..03c127864 --- /dev/null +++ b/debian/launch-authentic2.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +if [ -f /etc/default/authentic2 ]; then + . /etc/default/authentic2 +fi + +if [ -f /etc/authentic2/db.conf ]; then + . /etc/authentic2/db.conf +fi + +if [ -f /etc/authentic2/authentic.conf ]; then + . /etc/authentic2/authentic.conf +fi + +/usr/bin/gunicorn3 "$@"