diff mbox series

kea: set correct sysconfdir and localstatedir for keactrl

Message ID 20251126165806.3422444-1-yi.zhao@windriver.com
State New
Headers show
Series kea: set correct sysconfdir and localstatedir for keactrl | expand

Commit Message

Yi Zhao Nov. 26, 2025, 4:58 p.m. UTC
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.

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
---
 ...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
diff mbox series

Patch

diff --git a/meta/recipes-connectivity/kea/files/0001-keactrl-set-correct-sysconfdir-and-localstatedir.patch b/meta/recipes-connectivity/kea/files/0001-keactrl-set-correct-sysconfdir-and-localstatedir.patch
new file mode 100644
index 0000000000..0404fb15cf
--- /dev/null
+++ b/meta/recipes-connectivity/kea/files/0001-keactrl-set-correct-sysconfdir-and-localstatedir.patch
@@ -0,0 +1,47 @@ 
+From 2e9cf3d04d1772660fb8b36df574a055c93764c5 Mon Sep 17 00:00:00 2001
+From: Yi Zhao <yi.zhao@windriver.com>
+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 <yi.zhao@windriver.com>
+---
+ 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
+
diff --git a/meta/recipes-connectivity/kea/kea_3.0.1.bb b/meta/recipes-connectivity/kea/kea_3.0.1.bb
index 8729b1162e..70738783b2 100644
--- a/meta/recipes-connectivity/kea/kea_3.0.1.bb
+++ b/meta/recipes-connectivity/kea/kea_3.0.1.bb
@@ -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