From: Aleš Mrázek Date: Wed, 17 Sep 2025 09:16:40 +0000 (+0200) Subject: controller/supervisord: policy:loader: do not wait for the READY notification X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=dbf40a880fffb9c0a2226755330e1ddc0b9b4651;p=thirdparty%2Fknot-resolver.git controller/supervisord: policy:loader: do not wait for the READY notification policy-loader automatically enters RUNNING state when spawned --- diff --git a/python/knot_resolver/controller/supervisord/config_file.py b/python/knot_resolver/controller/supervisord/config_file.py index 05e380dcf..a825b6233 100644 --- a/python/knot_resolver/controller/supervisord/config_file.py +++ b/python/knot_resolver/controller/supervisord/config_file.py @@ -104,7 +104,7 @@ class ProcessTypeConfig: logfile=supervisord_subprocess_log_dir(config) / "policy-loader.log", workdir=cwd, command=f"{KRESD_EXECUTABLE} -c {(policy_loader_config_file(config))} -c - -n", - environment="X-SUPERVISORD-TYPE=notify", + environment="", ) @staticmethod diff --git a/python/knot_resolver/controller/supervisord/supervisord.conf.j2 b/python/knot_resolver/controller/supervisord/supervisord.conf.j2 index 4179d5221..846f3110a 100644 --- a/python/knot_resolver/controller/supervisord/supervisord.conf.j2 +++ b/python/knot_resolver/controller/supervisord/supervisord.conf.j2 @@ -74,7 +74,8 @@ command={{ loader.command }} autostart=false stopsignal=TERM killasgroup=true -startsecs=300 +startsecs=0 +exitcodes=0 environment={{ loader.environment }} stdout_logfile=NONE stderr_logfile=NONE diff --git a/python/knot_resolver/datamodel/templates/policy-config.lua.j2 b/python/knot_resolver/datamodel/templates/policy-config.lua.j2 index fbd824b38..0b9997033 100644 --- a/python/knot_resolver/datamodel/templates/policy-config.lua.j2 +++ b/python/knot_resolver/datamodel/templates/policy-config.lua.j2 @@ -42,11 +42,5 @@ cache.open({{ cfg.cache.size_max.bytes() }}, 'lmdb://{{ cfg.cache.storage }}') {% endif %} --- This sleep() is necessary because of the possible --- termination of the policy-loader before it is --- added into starting_processes in sd_notify.py. --- If this happens, the READY notification will end with an error. -C.sleep(1) - -- exit policy-loader properly quit()