From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 16EA215827B for ; Thu, 21 Aug 2025 01:03:04 +0000 (UTC) Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id EE71F340F81 for ; Thu, 21 Aug 2025 01:03:03 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id B42C7110562; Thu, 21 Aug 2025 01:02:55 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (No client certificate requested) by bobolink.gentoo.org (Postfix) with ESMTPS id AF0D9110561 for ; Thu, 21 Aug 2025 01:02:55 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 671B9340DB0 for ; Thu, 21 Aug 2025 01:02:55 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id D022434C7 for ; Thu, 21 Aug 2025 01:02:53 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1755738089.343dd455206377eabcc66809abe255abdc751f56.sam@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: net-misc/kea/, net-misc/kea/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: net-misc/kea/files/kea-confd-r3 net-misc/kea/files/kea-initd-r3 net-misc/kea/kea-3.0.0.ebuild X-VCS-Directories: net-misc/kea/ net-misc/kea/files/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 343dd455206377eabcc66809abe255abdc751f56 X-VCS-Branch: master Date: Thu, 21 Aug 2025 01:02:53 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: d218d031-e021-4ece-a0d5-35e4e91116ca X-Archives-Hash: 0149f41e721aa1f037b3b591290b09a5 commit: 343dd455206377eabcc66809abe255abdc751f56 Author: Peter Leese peterleese org> AuthorDate: Fri Aug 8 20:54:18 2025 +0000 Commit: Sam James gentoo org> CommitDate: Thu Aug 21 01:01:29 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=343dd455 net-misc/kea: use a skeleton for kea services Add new init & conf scripts provided by Nicolas PARLANT parhuet.fr> Signed-off-by: Peter Leese peterleese.org> Part-of: https://github.com/gentoo/gentoo/pull/43307 Signed-off-by: Sam James gentoo.org> net-misc/kea/files/kea-confd-r3 | 8 +++++ net-misc/kea/files/kea-initd-r3 | 76 +++++++++++++++++++++++++++++++++++++++++ net-misc/kea/kea-3.0.0.ebuild | 24 +++++++++++-- 3 files changed, 105 insertions(+), 3 deletions(-) diff --git a/net-misc/kea/files/kea-confd-r3 b/net-misc/kea/files/kea-confd-r3 new file mode 100644 index 000000000000..a8844bae730b --- /dev/null +++ b/net-misc/kea/files/kea-confd-r3 @@ -0,0 +1,8 @@ +# KEA_SVC must be defined here! +# Available values: dhcp4 dhcp6 dhcp-ddns ctrl-agent +KEA_SVC="@KEA_SVC@" + +#KEA_USER=dhcp +#KEA_GROUP=dhcp +#KEA_CONFIG=/etc/kea/kea-@KEA_SVC@.conf +#KEA_PIDFILE=/run/kea/kea-@KEA_SVC@.kea-@KEA_SVC@.pid diff --git a/net-misc/kea/files/kea-initd-r3 b/net-misc/kea/files/kea-initd-r3 new file mode 100644 index 000000000000..d499c6c193d9 --- /dev/null +++ b/net-misc/kea/files/kea-initd-r3 @@ -0,0 +1,76 @@ +#!/sbin/openrc-run +# Copyright 2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +: ${KEA_USER:=dhcp} +: ${KEA_GROUP:=dhcp} +: ${KEA_CONFIG:=/etc/kea/${RC_SVCNAME}.conf} +: ${KEA_PIDFILE:=/run/kea/${RC_SVCNAME}.kea-${KEA_SVC}.pid} + +description="kea ${KEA_SVC} services" +command="/usr/sbin/kea-${KEA_SVC}" +command_args="-c ${KEA_CONFIG}" +command_user="${KEA_USER}:${KEA_GROUP}" +pidfile="${KEA_PIDFILE}" +required_files="${KEA_CONFIG}" +start_stop_daemon_args="--background" + +extra_commands="check_kea_svc checkconfig" +extra_started_commands="reload" + +check_kea_svc() { + if [ "${RC_SVCNAME}" = "kea" ]; then + eerror "You are not supposed to run this script directly." + eerror "Create a symlink for the kea service you want to run." + eerror "Symlinks should have been created during installation." + return 1 + fi + + case "${KEA_SVC}" in + dhcp4) + capabilities="^cap_net_bind_service,^cap_net_raw" + ;; + dhcp6|dhcp-ddns) + capabilities="^cap_net_bind_service" + ;; + ctrl-agent) + ;; + *) + eerror "KEA_SVC is undefined or invalid!" + eerror "It should be defined in /etc/conf.d/${RC_SVCNAME}" + return 1 + ;; + esac +} + +checkconfig() { + ${command} -t ${KEA_CONFIG} 1>/dev/null 2>/dev/null || return 1 +} + +reload() { + checkconfig || return 1 + ebegin "Reloading ${RC_SVCNAME}" + start-stop-daemon --signal HUP --pidfile ${pidfile} + eend $? +} + +start_pre() { + check_kea_svc || return 1 + + if [ $(stat -c "%U:%G" ${KEA_CONFIG}) != "root:${KEA_GROUP}" ] ; then + eerror "${KEA_CONFIG} config file is not owned by root:${KEA_GROUP}" + eerror "you should reset the ownership:" + eerror "chown root:${KEA_GROUP} ${KEA_CONFIG}" + return 1 + fi + + if [ "${RC_CMD}" != "restart" ]; then + checkconfig || return 1 + fi +} + +stop_pre() { + if [ "${RC_CMD}" != "restart" ]; then + checkconfig || return 1 + fi +} diff --git a/net-misc/kea/kea-3.0.0.ebuild b/net-misc/kea/kea-3.0.0.ebuild index 182dbd12d0d8..bed33f18bcb4 100644 --- a/net-misc/kea/kea-3.0.0.ebuild +++ b/net-misc/kea/kea-3.0.0.ebuild @@ -9,7 +9,7 @@ inherit eapi9-ver flag-o-matic meson python-r1 systemd tmpfiles toolchain-funcs DESCRIPTION="High-performance production grade DHCPv4 & DHCPv6 server" HOMEPAGE="https://www.isc.org/kea/" -if [[ ${PV} == *9999* ]]; then +if [[ ${PV} == 9999 ]]; then inherit git-r3 EGIT_REPO_URI="https://gitlab.isc.org/isc-projects/kea.git" else @@ -232,8 +232,15 @@ src_install() { fowners -R root:dhcp /etc/${PN} - newconfd "${FILESDIR}"/${PN}-confd-r2 ${PN} - newinitd "${FILESDIR}"/${PN}-initd-r2 ${PN} + # Install a conf per service and a linked init script per service + newinitd "${FILESDIR}"/${PN}-initd-r3 ${PN} + local svc + for svc in dhcp4 dhcp6 dhcp-ddns ctrl-agent; do + newconfd "${FILESDIR}"/${PN}-confd-r3 kea-${svc} + sed -e "s:@KEA_SVC@:${svc}:g" \ + -i "${ED}"/etc/conf.d/kea-${svc} || die + dosym kea "${EPREFIX}"/etc/init.d/kea-${svc} + done systemd_newunit "${FILESDIR}"/${PN}-ctrl-agent.service-r2 ${PN}-ctrl-agent.service systemd_newunit "${FILESDIR}"/${PN}-dhcp-ddns.service-r2 ${PN}-dhcp-ddns.service @@ -264,6 +271,17 @@ pkg_postinst() { ewarn "Please check your configuration!" fi + if ver_replacing -lt 3.0; then + ewarn "If using openrc;" + ewarn " There are now separate conf.d scripts and associated init.d per daemon!" + ewarn " Each Daemon needs to be launched separately, i.e. the daemons are" + ewarn " kea-dhcp4" + ewarn " kea-dhcp6" + ewarn " kea-dhcp-ddns" + ewarn " kea-ctrl" + ewarn "Please adjust your service startups appropriately" + fi + if ! has_version net-misc/kea; then elog "See examples of config files in:" elog " ${EROOT}/usr/share/doc/${PF}/examples"