Projet

Général

Profil

0001-debian-manage-crons-through-uwsgi-64256.patch

Thomas Noël, 22 avril 2022 13:30

Télécharger (4,41 ko)

Voir les différences:

Subject: [PATCH] debian: manage crons through uwsgi (#64256)

 debian/authentic2-multitenant-uwsgi.ini |  8 ++++++++
 debian/authentic2-multitenant.cron.d    | 11 +----------
 debian/authentic2-uwsgi.ini             |  7 +++++++
 debian/authentic2.cron.d                | 10 +---------
 4 files changed, 17 insertions(+), 19 deletions(-)
debian/authentic2-multitenant-uwsgi.ini
16 16
spooler-python-import = authentic2.utils.spooler
17 17
spooler-max-tasks = 20
18 18

  
19
cron2 = minute=0,unique=1 /usr/bin/authentic2-multitenant-manage tenant_command clearsessions --all-tenants
20
cron2 = minute=5,unique=1 /usr/bin/authentic2-multitenant-manage tenant_command cleanupauthentic --all-tenants
21
cron2 = minute=15,unique=1 /usr/bin/authentic2-multitenant-manage tenant_command clean-unused-accounts --all-tenants
22
cron2 = minute=0,hour=0,week=0 /usr/bin/authentic2-multitenant-manage tenant_command clean-user-exports --all-tenants
23
# random sleep: try to avoid multiple machines overloading ldap server
24
cron2 = minute=10,unique=1,harakiri=14400 /bin/bash -c '/bin/sleep $[RANDOM %% 180]' && /usr/bin/authentic2-multitenant-manage tenant_command sync-ldap-users --all-tenants
25
cron2 = minute=30,hour=5,unique=1,harakiri=14400 /bin/bash -c '/bin/sleep $[RANDOM %% 180]' && /usr/bin/authentic2-multitenant-manage tenant_command deactivate-orphaned-ldap-users --all-tenants
26

  
19 27
master = true
20 28
enable-threads = true
21 29
harakiri = 120
debian/authentic2-multitenant.cron.d
1
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
2
MAILTO=root
3

  
4
0 * * * * authentic-multitenant authentic2-multitenant-manage tenant_command clearsessions --all-tenants
5
5 * * * * authentic-multitenant authentic2-multitenant-manage tenant_command cleanupauthentic --all-tenants
6
15 * * * * authentic-multitenant authentic2-multitenant-manage tenant_command clean-unused-accounts --all-tenants
7
0 0 * * 0 authentic-multitenant authentic2-multitenant-manage tenant_command clean-user-exports --all-tenants
8
# sleep to avoid multiple instance overloading ldap server
9
10 * * * * authentic-multitenant bash -c 'sleep $[RANDOM \% 120]' && authentic2-multitenant-manage tenant_command sync-ldap-users --all-tenants
10
30 5 * * * authentic-multitenant bash -c 'sleep $[RANDOM \% 300]' && authentic2-multitenant-manage tenant_command deactivate-orphaned-ldap-users --all-tenants
1
# crons managed by uwsgi; see /etc/authentic-multitenant/uwsgi.ini
debian/authentic2-uwsgi.ini
16 16
spooler-python-import = authentic2.utils.spooler
17 17
spooler-max-tasks = 20
18 18

  
19
cron2 = minute=0,unique=1 /usr/bin/authentic2-manage clearsessions
20
cron2 = minute=5,unique=1 /usr/bin/authentic2-manage cleanupauthentic
21
cron2 = minute=0,hour=5,unique=1 /usr/bin/authentic2-manage clean-unused-accounts
22
cron2 = minute=0,hour=0,week=0,unique=1 /usr/bin/authentic2-manage clean-user-exports
23
cron2 = minute=10,unique=1,harakiri=14400 /usr/bin/authentic2-manage sync-ldap-users
24
cron2 = minute=30,hour=5,unique=1,harakiri=14400 /usr/bin/authentic2-manage deactivate-orphaned-ldap-users
25

  
19 26
master = true
20 27
enable-threads = true
21 28
harakiri = 120
debian/authentic2.cron.d
1
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
2
MAILTO=root
3

  
4
0 * * * * authentic2 authentic2-manage clearsessions
5
5 * * * * authentic2 authentic2-manage cleanupauthentic
6
10 * * * * authentic2 authentic2-manage sync-ldap-users
7
0 5 * * * authentic2 authentic2-manage clean-unused-accounts
8
30 5 * * * authentic2 authentic2-manage deactivate-orphaned-ldap-users
9
0 0 * * 0 authentic2 authentic2-manage clean-user-exports
1
# crons managed by uwsgi; see /etc/authentic/uwsgi.ini
10
-