From: Yi Zhao <yi.zhao@windriver.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH 2/3 V2] kea: replace keactrl with kea daemons in initscripts
Date: Thu, 18 Dec 2025 21:44:25 +0800 [thread overview]
Message-ID: <20251218134426.4187527-2-yi.zhao@windriver.com> (raw)
In-Reply-To: <20251218134426.4187527-1-yi.zhao@windriver.com>
The keactrl script is used to run Kea from installation directory and is
primarily intended for developers[1][2]. The initscripts should call kea
daemon directly, rather than through the keactrl script.
Also add a volatile file to create runtime directory.
[1] https://gitlab.isc.org/isc-projects/kea/-/blob/master/src/bin/keactrl/keactrl.in?ref_type=heads#L10
[2] https://kea.readthedocs.io/en/latest/arm/keactrl.html
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
---
.../kea/files/kea-dhcp-ddns-server | 16 ++++++-----
.../kea/files/kea-dhcp4-server | 16 ++++++-----
.../kea/files/kea-dhcp6-server | 16 ++++++-----
.../kea/files/kea.volatiles | 2 ++
meta/recipes-connectivity/kea/kea_3.0.1.bb | 27 +++++++++++++------
5 files changed, 51 insertions(+), 26 deletions(-)
create mode 100644 meta/recipes-connectivity/kea/files/kea.volatiles
diff --git a/meta/recipes-connectivity/kea/files/kea-dhcp-ddns-server b/meta/recipes-connectivity/kea/files/kea-dhcp-ddns-server
index 50fe40d439..ebdf6f4dd6 100644
--- a/meta/recipes-connectivity/kea/files/kea-dhcp-ddns-server
+++ b/meta/recipes-connectivity/kea/files/kea-dhcp-ddns-server
@@ -11,8 +11,9 @@
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="kea-dhcp-ddns-server"
NAME=kea-dhcp-ddns
-DAEMON=/usr/sbin/keactrl
-DAEMON_ARGS=" -s dhcp_ddns"
+DAEMON=/usr/sbin/kea-dhcp-ddns
+DAEMON_ARGS="-c /etc/kea/kea-dhcp-ddns.conf"
+PIDFILE=/var/run/kea/kea-dhcp-ddns.kea-dhcp-ddns.pid
set -e
@@ -25,13 +26,12 @@ set -e
case "$1" in
start)
echo -n "Starting $DESC: "
- start-stop-daemon -S -b -n $NAME -x $DAEMON -- start $DAEMON_ARGS
+ start-stop-daemon -S -b -n $NAME -p $PIDFILE -x $DAEMON -- $DAEMON_ARGS
echo "done."
;;
stop)
echo -n "Stopping $DESC: "
- kpid=`pidof $NAME`
- kill $kpid
+ start-stop-daemon -K -p $PIDFILE -x $DAEMON
echo "done."
;;
restart|force-reload)
@@ -39,8 +39,12 @@ case "$1" in
$0 stop
$0 start
;;
+ status)
+ status $DAEMON
+ exit $?
+ ;;
*)
- echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
+ echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
exit 1
;;
esac
diff --git a/meta/recipes-connectivity/kea/files/kea-dhcp4-server b/meta/recipes-connectivity/kea/files/kea-dhcp4-server
index e83e51025d..247f15d7fb 100644
--- a/meta/recipes-connectivity/kea/files/kea-dhcp4-server
+++ b/meta/recipes-connectivity/kea/files/kea-dhcp4-server
@@ -11,8 +11,9 @@
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="kea-dhcp4-server"
NAME=kea-dhcp4
-DAEMON=/usr/sbin/keactrl
-DAEMON_ARGS=" -s dhcp4"
+DAEMON=/usr/sbin/kea-dhcp4
+DAEMON_ARGS="-c /etc/kea/kea-dhcp4.conf"
+PIDFILE=/var/run/kea/kea-dhcp4.kea-dhcp4.pid
set -e
@@ -25,13 +26,12 @@ set -e
case "$1" in
start)
echo -n "Starting $DESC: "
- start-stop-daemon -S -b -n $NAME -x $DAEMON -- start $DAEMON_ARGS
+ start-stop-daemon -S -b -n $NAME -p $PIDFILE -x $DAEMON -- $DAEMON_ARGS
echo "done."
;;
stop)
echo -n "Stopping $DESC: "
- kpid=`pidof $NAME`
- kill $kpid
+ start-stop-daemon -K -p $PIDFILE -x $DAEMON
echo "done."
;;
restart|force-reload)
@@ -39,8 +39,12 @@ case "$1" in
$0 stop
$0 start
;;
+ status)
+ status $DAEMON
+ exit $?
+ ;;
*)
- echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
+ echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
exit 1
;;
esac
diff --git a/meta/recipes-connectivity/kea/files/kea-dhcp6-server b/meta/recipes-connectivity/kea/files/kea-dhcp6-server
index 10f2d22641..c04393ddb8 100644
--- a/meta/recipes-connectivity/kea/files/kea-dhcp6-server
+++ b/meta/recipes-connectivity/kea/files/kea-dhcp6-server
@@ -12,8 +12,9 @@
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="kea-dhcp6-server"
NAME=kea-dhcp6
-DAEMON=/usr/sbin/keactrl
-DAEMON_ARGS=" -s dhcp6"
+DAEMON=/usr/sbin/kea-dhcp6
+DAEMON_ARGS="-c /etc/kea/kea-dhcp6.conf"
+PIDFILE=/var/run/kea/kea-dhcp6.kea-dhcp6.pid
set -e
@@ -26,13 +27,12 @@ set -e
case "$1" in
start)
echo -n "Starting $DESC: "
- start-stop-daemon -S -b -n $NAME -x $DAEMON -- start $DAEMON_ARGS
+ start-stop-daemon -S -b -n $NAME -p $PIDFILE -x $DAEMON -- $DAEMON_ARGS
echo "done."
;;
stop)
echo -n "Stopping $DESC: "
- kpid=`pidof $NAME`
- kill $kpid
+ start-stop-daemon -K -p $PIDFILE -x $DAEMON
echo "done."
;;
restart|force-reload)
@@ -40,8 +40,12 @@ case "$1" in
$0 stop
$0 start
;;
+ status)
+ status $DAEMON
+ exit $?
+ ;;
*)
- echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
+ echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
exit 1
;;
esac
diff --git a/meta/recipes-connectivity/kea/files/kea.volatiles b/meta/recipes-connectivity/kea/files/kea.volatiles
new file mode 100644
index 0000000000..d0350e38a6
--- /dev/null
+++ b/meta/recipes-connectivity/kea/files/kea.volatiles
@@ -0,0 +1,2 @@
+d root root 0750 /var/run/kea none
+d root root 0644 /var/lib/kea none
diff --git a/meta/recipes-connectivity/kea/kea_3.0.1.bb b/meta/recipes-connectivity/kea/kea_3.0.1.bb
index 1be557c79a..6b07ab8a4a 100644
--- a/meta/recipes-connectivity/kea/kea_3.0.1.bb
+++ b/meta/recipes-connectivity/kea/kea_3.0.1.bb
@@ -14,6 +14,7 @@ SRC_URI = "http://ftp.isc.org/isc/kea/${PV}/${BP}.tar.xz \
file://kea-dhcp4-server \
file://kea-dhcp6-server \
file://kea-dhcp-ddns-server \
+ file://kea.volatiles \
file://fix-multilib-conflict.patch \
file://fix_pid_keactrl.patch \
file://0001-src-lib-log-logger_unittest_support.cc-do-not-write-.patch \
@@ -61,17 +62,27 @@ do_compile:prepend:class-target() {
}
do_install:append() {
- install -d ${D}${sysconfdir}/init.d
- install -d ${D}${systemd_system_unitdir}
-
- install -m 0644 ${UNPACKDIR}/kea-dhcp*service ${D}${systemd_system_unitdir}
- 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
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
+ install -d ${D}${sysconfdir}/init.d
+ install -d ${D}/${sysconfdir}/default/volatiles
+
+ install -m 0755 ${UNPACKDIR}/kea-*-server ${D}${sysconfdir}/init.d
+ install -m 0644 ${UNPACKDIR}/kea.volatiles ${D}/${sysconfdir}/default/volatiles/99_kea
+ fi
+
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+ install -d ${D}${systemd_system_unitdir}
+ install -m 0644 ${UNPACKDIR}/kea-dhcp*service ${D}${systemd_system_unitdir}
+
+ 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
+ fi
+
sed -i -e "s:${B}:@abs_top_builddir_placeholder@:g" \
-e "s:${S}:@abs_top_srcdir_placeholder@:g" \
${D}${sbindir}/kea-admin
+
rm -rf ${D}${datadir}/${BPN}/meson-info
rm -rf ${D}${runtimedir}
rm -rf ${D}${localstatedir}
--
2.34.1
next prev parent reply other threads:[~2025-12-18 13:44 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-18 13:44 [PATCH 1/3 V2] kea: fix creating runtime directory in service files Yi Zhao
2025-12-18 13:44 ` Yi Zhao [this message]
2025-12-18 13:44 ` [PATCH 3/3 V2] kea: remove keactrl from package Yi Zhao
2025-12-22 17:34 ` [OE-core] [PATCH 1/3 V2] kea: fix creating runtime directory in service files Randy MacLeod
2025-12-23 13:41 ` Yi Zhao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251218134426.4187527-2-yi.zhao@windriver.com \
--to=yi.zhao@windriver.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox