From: Yi Zhao Date: Mon, 12 Jan 2026 08:11:57 +0000 (+0800) Subject: kea: replace keactrl with kea daemons in initscripts X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7f9d9297a84f8f5dc08bc310f825ac8a4acf5452;p=thirdparty%2Fopenembedded%2Fopenembedded-core.git kea: replace keactrl with kea daemons in initscripts 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 and state directories. [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 Signed-off-by: Antonin Godard Signed-off-by: Richard Purdie --- 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.2.bb b/meta/recipes-connectivity/kea/kea_3.0.2.bb index 11e9bd13a2..ae1a1a74cf 100644 --- a/meta/recipes-connectivity/kea/kea_3.0.2.bb +++ b/meta/recipes-connectivity/kea/kea_3.0.2.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 \ @@ -63,17 +64,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}