summaryrefslogtreecommitdiffstats
path: root/python/knot_resolver/controller/supervisord/supervisord.conf.j2
blob: 4179d522114e3885946c6705155e501f0e1392f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
[supervisord]
pidfile = {{ config.pid_file }}
directory = {{ config.workdir }}
nodaemon = true

{# disable initial logging until patch_logger.py takes over #}
logfile = /dev/null
logfile_maxbytes = 0
silent = true

{# config for patch_logger.py #}
loglevel = {{ config.loglevel }}
{# there are more options in the plugin section #}

[unix_http_server]
file = {{ config.unix_http_server }}

[supervisorctl]
serverurl = unix://{{ config.unix_http_server }}

{# Extensions to changing the supervisord behavior #}
[rpcinterface:patch_logger]
supervisor.rpcinterface_factory = knot_resolver.controller.supervisord.plugin.patch_logger:inject
target = {{ config.target }}

[rpcinterface:manager_integration]
supervisor.rpcinterface_factory = knot_resolver.controller.supervisord.plugin.manager_integration:inject

[rpcinterface:sd_notify]
supervisor.rpcinterface_factory = knot_resolver.controller.supervisord.plugin.sd_notify:inject

{# Extensions for actual API control #}
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface

[rpcinterface:fast]
supervisor.rpcinterface_factory = knot_resolver.controller.supervisord.plugin.fast_rpcinterface:make_main_rpcinterface

[program:manager]
redirect_stderr=false
directory={{ manager.workdir }}
command={{ manager.command }}
stopsignal=SIGINT
killasgroup=true
autorestart=true
autostart=true
{# Note that during startup,
   manager will signal being ready only after sequential startup of all kresd workers,
   i.e. it might take lots of time currently, if the user configured very large rulesets (e.g. huge RPZ).
   Let's permit it lots of time, assuming that useful work is being done.
#}
startsecs=600
environment={{ manager.environment }},KRES_SUPRESS_LOG_PREFIX=true
stdout_logfile=NONE
stderr_logfile=NONE

[program:kresd]
process_name=%(program_name)s%(process_num)d
numprocs={{ kresd.max_procs }}
directory={{ kresd.workdir }}
command={{ kresd.command }}
autostart=false
autorestart=true
stopsignal=TERM
killasgroup=true
startsecs=60
environment={{ kresd.environment }}
stdout_logfile=NONE
stderr_logfile=NONE

[program:policy-loader]
directory={{ loader.workdir }}
command={{ loader.command }}
autostart=false
stopsignal=TERM
killasgroup=true
startsecs=300
environment={{ loader.environment }}
stdout_logfile=NONE
stderr_logfile=NONE

[program:cache-gc]
redirect_stderr=false
directory={{ gc.workdir }}
command={{ gc.command }}
autostart=false
autorestart=true
stopsignal=TERM
killasgroup=true
startsecs=0
environment={{ gc.environment }}
stdout_logfile=NONE
stderr_logfile=NONE