Projet

Général

Profil

0003-misc-add-uwsgi-spooler-50891.patch

Valentin Deniaud, 17 février 2021 11:47

Télécharger (3,79 ko)

Voir les différences:

Subject: [PATCH 3/4] misc: add uwsgi spooler (#50891)

 combo/utils/spooler.py | 15 +++++++++++++++
 debian/combo.dirs      |  1 +
 debian/combo.init      |  1 +
 debian/combo.postinst  |  1 +
 debian/combo.service   |  3 ++-
 debian/control         |  3 ++-
 debian/uwsgi.ini       |  3 +++
 7 files changed, 25 insertions(+), 2 deletions(-)
 create mode 100644 combo/utils/spooler.py
combo/utils/spooler.py
1
# combo - content management system
2
# Copyright (C) 2021  Entr'ouvert
3
#
4
# This program is free software: you can redistribute it and/or modify it
5
# under the terms of the GNU Affero General Public License as published
6
# by the Free Software Foundation, either version 3 of the License, or
7
# (at your option) any later version.
8
#
9
# This program is distributed in the hope that it will be useful,
10
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
# GNU Affero General Public License for more details.
13
#
14
# You should have received a copy of the GNU Affero General Public License
15
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
debian/combo.dirs
4 4
/var/lib/combo/collectstatic
5 5
/var/lib/combo/tenants
6 6
/var/log/combo
7
/var/lib/combo/spooler
debian/combo.init
39 39
DAEMON_ARGS=${DAEMON_ARGS:-"--pidfile=$PIDFILE
40 40
--uid $USER --gid $GROUP
41 41
--ini /etc/$NAME/uwsgi.ini
42
--spooler /var/lib/$NAME/spooler/
42 43
--daemonize /var/log/uwsgi.$NAME.log"}
43 44

  
44 45
# Load the VERBOSE setting and other rcS variables
debian/combo.postinst
21 21
    chown $USER:$GROUP /var/log/$NAME
22 22
    chown $USER:$GROUP /var/lib/$NAME/collectstatic
23 23
    chown $USER:$GROUP /var/lib/$NAME/tenants
24
    chown $USER:$GROUP /var/lib/$NAME/spooler
24 25
    # create a secret file
25 26
    SECRET_FILE=$CONFIG_DIR/secret
26 27
    if [ ! -f $SECRET_FILE ]; then
debian/combo.service
10 10
Group=%p
11 11
ExecStartPre=/usr/bin/combo-manage migrate_schemas --noinput --verbosity 1
12 12
ExecStartPre=/usr/bin/combo-manage collectstatic --noinput
13
ExecStart=/usr/bin/uwsgi --ini /etc/%p/uwsgi.ini
13
ExecStartPre=/bin/mkdir -p /var/lib/combo/spooler/%m/
14
ExecStart=/usr/bin/uwsgi --ini /etc/%p/uwsgi.ini --spooler /var/lib/combo/spooler/%m/
14 15
ExecReload=/bin/kill -HUP $MAINPID
15 16
KillSignal=SIGQUIT
16 17
TimeoutStartSec=0
debian/control
41 41
    python3-psycopg2,
42 42
    python3-django-mellon (>= 1.13),
43 43
    uwsgi,
44
    uwsgi-plugin-python3
44
    uwsgi-plugin-python3,
45
    python3-uwsgidecorators
45 46
Recommends: nginx
46 47
Suggests: postgresql
47 48
Breaks: python-combo (<< 2.34.post2)
debian/uwsgi.ini
9 9
chmod-socket = 666
10 10
vacuum = true
11 11

  
12
spooler-processes = 3
13
spooler-python-import = combo.utils.spooler
14

  
12 15
master = true
13 16
processes = 5
14 17
harakiri = 120
15
-