From 5efad0461d64da6c0416a04c7070160e2e863986 Mon Sep 17 00:00:00 2001 From: Valentin Deniaud Date: Tue, 9 Mar 2021 10:48:30 +0100 Subject: [PATCH 1/3] misc: add uwsgi spooler (#43153) --- debian/authentic2-multitenant-uwsgi.ini | 3 +++ debian/authentic2-uwsgi.ini | 3 +++ debian/authentic2.dirs | 1 + debian/authentic2.init | 1 + debian/authentic2.postinst | 1 + debian/authentic2.service | 3 ++- debian/control | 1 + 7 files changed, 12 insertions(+), 1 deletion(-) diff --git a/debian/authentic2-multitenant-uwsgi.ini b/debian/authentic2-multitenant-uwsgi.ini index 2ed63348..a5063247 100644 --- a/debian/authentic2-multitenant-uwsgi.ini +++ b/debian/authentic2-multitenant-uwsgi.ini @@ -12,6 +12,9 @@ http-socket = /run/authentic2-multitenant/authentic2-multitenant.sock chmod-socket = 666 vacuum = true +spooler-processes = 3 +spooler-python-import = authentic2.utils.spooler + master = true enable-threads = true harakiri = 120 diff --git a/debian/authentic2-uwsgi.ini b/debian/authentic2-uwsgi.ini index 97b2abb1..9b07db57 100644 --- a/debian/authentic2-uwsgi.ini +++ b/debian/authentic2-uwsgi.ini @@ -12,6 +12,9 @@ http-socket = /run/authentic2/authentic2.sock chmod-socket = 666 vacuum = true +spooler-processes = 3 +spooler-python-import = authentic2.utils.spooler + master = true enable-threads = true harakiri = 120 diff --git a/debian/authentic2.dirs b/debian/authentic2.dirs index 31134cff..583f2be2 100644 --- a/debian/authentic2.dirs +++ b/debian/authentic2.dirs @@ -6,4 +6,5 @@ var/lib/authentic2/static var/lib/authentic2/collectstatic var/lib/authentic2/locale var/lib/authentic2/templates +var/lib/authentic2/spooler var/log/authentic2 diff --git a/debian/authentic2.init b/debian/authentic2.init index 560fb97d..b79f8228 100644 --- a/debian/authentic2.init +++ b/debian/authentic2.init @@ -38,6 +38,7 @@ GROUP=authentic2 DAEMON_ARGS=${DAEMON_ARGS:-"--pidfile=$PIDFILE --uid $USER --gid $GROUP --ini /etc/$NAME/$NAME-uwsgi.ini +--spooler /var/lib/$NAME/spooler/ --daemonize /var/log/uwsgi.$NAME.log"} # Load the VERBOSE setting and other rcS variables diff --git a/debian/authentic2.postinst b/debian/authentic2.postinst index 2a311018..0f0f3f8a 100644 --- a/debian/authentic2.postinst +++ b/debian/authentic2.postinst @@ -98,6 +98,7 @@ case "$1" in $AUTHENTIC_HOME/locale \ $AUTHENTIC_HOME/media \ $AUTHENTIC_HOME/templates \ + $AUTHENTIC_HOME/spooler \ /var/log/$NAME \ ;; diff --git a/debian/authentic2.service b/debian/authentic2.service index 8ee92b22..63cc2f01 100644 --- a/debian/authentic2.service +++ b/debian/authentic2.service @@ -10,7 +10,8 @@ User=authentic2 Group=authentic2 ExecStartPre=/usr/bin/authentic2-manage migrate --noinput ExecStartPre=/usr/bin/authentic2-manage collectstatic --noinput -ExecStart=/usr/lib/authentic2/launch-authentic2.sh --ini /etc/%p/%p-uwsgi.ini +ExecStartPre=/bin/mkdir -p /var/lib/authentic2/spooler/%m/ +ExecStart=/usr/lib/authentic2/launch-authentic2.sh --ini /etc/%p/%p-uwsgi.ini --spooler /var/lib/authentic2/spooler/%m/ ExecReload=/bin/kill -HUP $MAINPID KillSignal=SIGQUIT TimeoutStartSec=0 diff --git a/debian/control b/debian/control index 37f59d68..f8f63446 100644 --- a/debian/control +++ b/debian/control @@ -58,6 +58,7 @@ Depends: ${misc:Depends}, adduser, python3-psycopg2, uwsgi, uwsgi-plugin-python3, + python3-uwsgidecorators, dbconfig-common, debconf | debconf-2.0, ucf Recommends: postgresql-client -- 2.20.1