kea: set correct sysconfdir and localstatedir for keactrl
PATCH 1/1 kea: set correct sysconfdir and localstatedir for keactrl
In keactrl script, both sysconfdir and localstatedir are prefixed with ${prefix}, causing an error when keactrl runs:
$ keactrl start -s dhcp4 ERROR/keactrl: keactrl configuration file doesn't exist in /usr//etc/kea/keactrl.conf.
Remove ${prefix} to ensure keactrl can find the correct directory.
--- ...correct-sysconfdir-and-localstatedir.patch | 47 +++++++++++++++++++ meta/recipes-connectivity/kea/kea_3.0.1.bb | 3 +- 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 meta/recipes-connectivity/kea/files/0001-keactrl-set-correct-sysconfdir-and-localstatedir.patch
meta/recipes-connectivity/kea/files/0001-keactrl-set-correct-sysconfdir-and-localstatedir.patch new file +47 -0
@@ -0,0 +1,47 @@ +From 2e9cf3d04d1772660fb8b36df574a055c93764c5 Mon Sep 17 00:00:00 2001 +From: Yi Zhao <[email protected]> +Date: Thu, 27 Nov 2025 00:27:48 +0800 +Subject: [PATCH] keactrl: set correct sysconfdir and localstatedir + +In keactrl script, both sysconfdir and localstatedir are prefixed with +${prefix}, causing an error when keactrl runs: + +$ keactrl start -s dhcp4 +ERROR/keactrl: keactrl configuration file doesn't exist in /usr//etc/kea/keactrl.conf. + +Remove ${prefix} to ensure keactrl can find the correct directory. + +Upstream-Status: Inappropriate [embedded specific] + +Signed-off-by: Yi Zhao <[email protected]> +--- + src/bin/keactrl/meson.build | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/bin/keactrl/meson.build b/src/bin/keactrl/meson.build +index 0b5b860..63684b1 100644 +--- a/src/bin/keactrl/meson.build ++++ b/src/bin/keactrl/meson.build +@@ -3,7 +3,7 @@ keactrl_conf_data.set('PACKAGE', 'kea') + keactrl_conf_data.set('exec_prefix', '${prefix}') + keactrl_conf_data.set('prefix', PREFIX) + keactrl_conf_data.set('sbindir', '${prefix}/' + SBINDIR) +-keactrl_conf_data.set('sysconfdir', '${prefix}/' + SYSCONFDIR) ++keactrl_conf_data.set('sysconfdir', SYSCONFDIR) + if NETCONF_DEP.found() + keactrl_conf_data.set('HAVE_NETCONF', 'yes') + else +@@ -14,8 +14,8 @@ keactrl_conf_data.set( + PROJECT_VERSION + f' (@SOURCE_OF_INSTALLATION@)', + ) + keactrl_conf_data.set('PACKAGE_VERSION', PROJECT_VERSION) +-keactrl_conf_data.set('runstatedir', '${prefix}/' + LOCALSTATEDIR + '/run') +-keactrl_conf_data.set('localstatedir', '${prefix}/' + LOCALSTATEDIR) ++keactrl_conf_data.set('runstatedir', LOCALSTATEDIR + '/run') ++keactrl_conf_data.set('localstatedir', LOCALSTATEDIR) + + kea_conf_data = configuration_data() + kea_conf_data.set('libdir', LIBDIR_INSTALLED) +-- +2.34.1 +
meta/recipes-connectivity/kea/kea_3.0.1.bb +2 -1
@@ -22,6 +22,7 @@ SRC_URI = "http://ftp.isc.org/isc/kea/${PV}/${BP}.tar.xz \ file://0001-mk_cfgrpt.sh-strip-prefixes.patch \ file://0001-d2-dhcp-46-radius-dhcpsrv-Avoid-Boost-lexical_cast-o.patch \ file://CVE-2025-11232.patch \ + file://0001-keactrl-set-correct-sysconfdir-and-localstatedir.patch \ " SRC_URI[sha256sum] = "ec84fec4bb7f6b9d15a82e755a571e9348eb4d6fbc62bb3f6f1296cd7a24c566"
@@ -68,7 +69,7 @@ do_install:append() { install -m 0755 ${UNPACKDIR}/kea-*-server ${D}${sysconfdir}/init.d sed -i -e 's,@SBINDIR@,${sbindir},g' -e 's,@BASE_BINDIR@,${base_bindir},g' \ -e 's,@LOCALSTATEDIR@,${localstatedir},g' -e 's,@SYSCONFDIR@,${sysconfdir},g' \ - ${D}${systemd_system_unitdir}/kea-dhcp*service ${D}${sbindir}/keactrl + ${D}${systemd_system_unitdir}/kea-dhcp*service sed -i -e "s:${B}:@abs_top_builddir_placeholder@:g" \ -e "s:${S}:@abs_top_srcdir_placeholder@:g" \ ${D}${sbindir}/kea-admin
Signature · 1 line
2.34.1
Quoted 8 lines · Yi Zhao via lists.openembedded.org
In keactrl script, both sysconfdir and localstatedir are prefixed with ${prefix}, causing an error when keactrl runs:
$ keactrl start -s dhcp4 ERROR/keactrl: keactrl configuration file doesn't exist in /usr//etc/kea/keactrl.conf.Remove ${prefix} to ensure keactrl can find the correct directory.
This isn’t the right thing to do.
Well, the scripts _are_ broken because they do prefix+sysconfdir, which is just wrong. Upstream should fix that.
However, keactrl appears to be a tool for developers of kea who want to start/stop the daemon, and our init scripts should just call the kea daemons directly instead of going via an init script.
Can you send a patch to port the init scripts to invoke the daemons directly, and remove keactrl from the packaging?
Thanks,
Ross
Quoted 7 lines · Ross Burton
Quoted 6 lines · Yi Zhao via lists.openembedded.org
In keactrl script, both sysconfdir and localstatedir are prefixed with ${prefix}, causing an error when keactrl runs:
$ keactrl start -s dhcp4 ERROR/keactrl: keactrl configuration file doesn't exist in /usr//etc/kea/keactrl.conf.
Quoted 8 lines
Quoted 1 line
Remove ${prefix} to ensure keactrl can find the correct directory.
This isn’t the right thing to do.
Well, the scripts _are_ broken because they do prefix+sysconfdir, which is just wrong. Upstream should fix that.
However, keactrl appears to be a tool for developers of kea who want to start/stop the daemon, and our init scripts should just call the kea daemons directly instead of going via an init script.
Can you send a patch to port the init scripts to invoke the daemons directly, and remove keactrl from the packaging?
OK. I will send a new patch to fix it.
//Yi
Quoted 3 lines
Thanks,
Ross