From: Vladimír Čunát Date: Mon, 3 Feb 2025 15:33:04 +0000 (+0100) Subject: datamodel: policy-loader: avoid dependency on lua-cqueues X-Git-Tag: v6.0.11~9^2~1 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=21a76cd86221761b4d8c3c2dce24720238150468;p=thirdparty%2Fknot-resolver.git datamodel: policy-loader: avoid dependency on lua-cqueues --- diff --git a/daemon/lua/kres-gen-33.lua b/daemon/lua/kres-gen-33.lua index 9bf16b7f4..f37cc7c6a 100644 --- a/daemon/lua/kres-gen-33.lua +++ b/daemon/lua/kres-gen-33.lua @@ -11,6 +11,8 @@ struct timeval { __suseconds_t tv_usec; }; +unsigned sleep(unsigned seconds); + typedef struct knot_dump_style knot_dump_style_t; extern const knot_dump_style_t KR_DUMP_STYLE_DEFAULT; struct kr_cdb_api {}; diff --git a/daemon/lua/kres-gen.sh b/daemon/lua/kres-gen.sh index 910c5b75b..eeb101d85 100755 --- a/daemon/lua/kres-gen.sh +++ b/daemon/lua/kres-gen.sh @@ -62,6 +62,10 @@ struct timeval { __suseconds_t tv_usec; }; " +# We use this in policy-loader +printf " +unsigned sleep(unsigned seconds); +" ## Various types (mainly), from libknot and libkres diff --git a/python/knot_resolver/datamodel/templates/policy-config.lua.j2 b/python/knot_resolver/datamodel/templates/policy-config.lua.j2 index 3fbb7cc11..fbd824b38 100644 --- a/python/knot_resolver/datamodel/templates/policy-config.lua.j2 +++ b/python/knot_resolver/datamodel/templates/policy-config.lua.j2 @@ -46,7 +46,7 @@ cache.open({{ cfg.cache.size_max.bytes() }}, 'lmdb://{{ cfg.cache.storage }}') -- 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. -worker.sleep(1) +C.sleep(1) -- exit policy-loader properly quit()