summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmmanuel Cazenave <ecazenave@entrouvert.com>2021-07-13 13:30:27 (GMT)
committerEmmanuel Cazenave <ecazenave@entrouvert.com>2021-08-26 09:14:39 (GMT)
commit6432625ff2e164e2c4fcbe30ddac70f549ab30b1 (patch)
tree9ce760dca3b29cdae0ba631fce96c4621bff03b0
parentaec0edb0c84758bc1c9ea7cd965d7b8311cbf9f2 (diff)
downloadwelco-wip/55570-spooler.zip
welco-wip/55570-spooler.tar.gz
welco-wip/55570-spooler.tar.bz2
debian: add uwsgi spooler (#55570)wip/55570-spooler
-rw-r--r--debian/control1
-rw-r--r--debian/uwsgi.ini3
-rw-r--r--debian/welco.dirs1
-rw-r--r--debian/welco.init1
-rw-r--r--debian/welco.postinst1
-rw-r--r--debian/welco.service3
6 files changed, 9 insertions, 1 deletions
diff --git a/debian/control b/debian/control
index 8911c11..83af826 100644
--- a/debian/control
+++ b/debian/control
@@ -25,6 +25,7 @@ Depends: ${misc:Depends},
python3-django-tenant-schemas,
python3-psycopg2,
python3-django-mellon,
+ python3-uwsgidecorators,
python3-xstatic-select2,
uwsgi,
uwsgi-plugin-python3,
diff --git a/debian/uwsgi.ini b/debian/uwsgi.ini
index 400fba1..d5dab70 100644
--- a/debian/uwsgi.ini
+++ b/debian/uwsgi.ini
@@ -9,6 +9,9 @@ http-socket = /run/welco/welco.sock
chmod-socket = 666
vacuum = true
+spooler-processes = 3
+spooler-max-tasks = 20
+
master = true
processes = 5
harakiri = 120
diff --git a/debian/welco.dirs b/debian/welco.dirs
index 465820d..3123ebc 100644
--- a/debian/welco.dirs
+++ b/debian/welco.dirs
@@ -1,5 +1,6 @@
/etc/welco
/usr/lib/welco
/var/lib/welco/collectstatic
+/var/lib/welco/spooler
/var/lib/welco/tenants
/var/log/welco
diff --git a/debian/welco.init b/debian/welco.init
index 4cc71ae..1c15879 100644
--- a/debian/welco.init
+++ b/debian/welco.init
@@ -38,6 +38,7 @@ GROUP=$NAME
DAEMON_ARGS=${DAEMON_ARGS:-"--pidfile=$PIDFILE
--uid $USER --gid $GROUP
--ini /etc/$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/welco.postinst b/debian/welco.postinst
index 00302fe..2fdff4d 100644
--- a/debian/welco.postinst
+++ b/debian/welco.postinst
@@ -20,6 +20,7 @@ case "$1" in
# ensure dirs ownership
chown $USER:$GROUP /var/log/$NAME
chown $USER:$GROUP /var/lib/$NAME/collectstatic
+ chown $USER:$GROUP /var/lib/$NAME/spooler
chown $USER:$GROUP /var/lib/$NAME/tenants
# create a secret file
SECRET_FILE=$CONFIG_DIR/secret
diff --git a/debian/welco.service b/debian/welco.service
index 124d9db..a75638e 100644
--- a/debian/welco.service
+++ b/debian/welco.service
@@ -10,7 +10,8 @@ User=%p
Group=%p
ExecStartPre=/usr/bin/welco-manage migrate_schemas --noinput --verbosity 1
ExecStartPre=/usr/bin/welco-manage collectstatic --noinput
-ExecStart=/usr/bin/uwsgi --ini /etc/%p/uwsgi.ini
+ExecStartPre=/bin/mkdir -p /var/lib/welco/spooler/%m/
+ExecStart=/usr/bin/uwsgi --ini /etc/%p/uwsgi.ini --spooler /var/lib/welco/spooler/%m/
ExecReload=/bin/kill -HUP $MAINPID
KillSignal=SIGQUIT
TimeoutStartSec=0