debian: manage crons through uwsgi (#64256)

This commit is contained in:
Thomas NOËL 2022-04-22 13:30:06 +02:00
parent 0cfd6ba7b5
commit 8d37449a5e
4 changed files with 17 additions and 19 deletions

View File

@ -16,6 +16,14 @@ spooler-processes = 5
spooler-python-import = authentic2.utils.spooler
spooler-max-tasks = 20
cron2 = minute=0,unique=1 /usr/bin/authentic2-multitenant-manage tenant_command clearsessions --all-tenants
cron2 = minute=5,unique=1 /usr/bin/authentic2-multitenant-manage tenant_command cleanupauthentic --all-tenants
cron2 = minute=15,unique=1 /usr/bin/authentic2-multitenant-manage tenant_command clean-unused-accounts --all-tenants
cron2 = minute=0,hour=0,week=0 /usr/bin/authentic2-multitenant-manage tenant_command clean-user-exports --all-tenants
# random sleep: try to avoid multiple machines overloading ldap server
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
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
master = true
enable-threads = true
harakiri = 120

View File

@ -1,10 +1 @@
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
0 * * * * authentic-multitenant authentic2-multitenant-manage tenant_command clearsessions --all-tenants
5 * * * * authentic-multitenant authentic2-multitenant-manage tenant_command cleanupauthentic --all-tenants
15 * * * * authentic-multitenant authentic2-multitenant-manage tenant_command clean-unused-accounts --all-tenants
0 0 * * 0 authentic-multitenant authentic2-multitenant-manage tenant_command clean-user-exports --all-tenants
# sleep to avoid multiple instance overloading ldap server
10 * * * * authentic-multitenant bash -c 'sleep $[RANDOM \% 120]' && authentic2-multitenant-manage tenant_command sync-ldap-users --all-tenants
30 5 * * * authentic-multitenant bash -c 'sleep $[RANDOM \% 300]' && authentic2-multitenant-manage tenant_command deactivate-orphaned-ldap-users --all-tenants
# crons managed by uwsgi; see /etc/authentic-multitenant/uwsgi.ini

View File

@ -16,6 +16,13 @@ spooler-processes = 3
spooler-python-import = authentic2.utils.spooler
spooler-max-tasks = 20
cron2 = minute=0,unique=1 /usr/bin/authentic2-manage clearsessions
cron2 = minute=5,unique=1 /usr/bin/authentic2-manage cleanupauthentic
cron2 = minute=0,hour=5,unique=1 /usr/bin/authentic2-manage clean-unused-accounts
cron2 = minute=0,hour=0,week=0,unique=1 /usr/bin/authentic2-manage clean-user-exports
cron2 = minute=10,unique=1,harakiri=14400 /usr/bin/authentic2-manage sync-ldap-users
cron2 = minute=30,hour=5,unique=1,harakiri=14400 /usr/bin/authentic2-manage deactivate-orphaned-ldap-users
master = true
enable-threads = true
harakiri = 120

View File

@ -1,9 +1 @@
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
0 * * * * authentic2 authentic2-manage clearsessions
5 * * * * authentic2 authentic2-manage cleanupauthentic
10 * * * * authentic2 authentic2-manage sync-ldap-users
0 5 * * * authentic2 authentic2-manage clean-unused-accounts
30 5 * * * authentic2 authentic2-manage deactivate-orphaned-ldap-users
0 0 * * 0 authentic2 authentic2-manage clean-user-exports
# crons managed by uwsgi; see /etc/authentic/uwsgi.ini