summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wendler <polynomial-c@gentoo.org>2020-11-25 10:23:35 +0100
committerLars Wendler <polynomial-c@gentoo.org>2020-11-25 10:26:53 +0100
commitffd78423b98731909dd4404293641b3722bc2dc5 (patch)
tree8cd2cbcb6d7f8b27569bab5664d938f8de71c964 /net-misc/kea/files
parentdev-python/oslo-upgradecheck: Mark ALLARCHES (diff)
downloadgentoo-ffd78423b98731909dd4404293641b3722bc2dc5.tar.gz
gentoo-ffd78423b98731909dd4404293641b3722bc2dc5.tar.bz2
gentoo-ffd78423b98731909dd4404293641b3722bc2dc5.zip
net-misc/kea: Bump to version 1.8.1
Fixed init script to not use a single file for all daemons Closes: https://bugs.gentoo.org/738026 Package-Manager: Portage-3.0.10, Repoman-3.0.2 Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
Diffstat (limited to 'net-misc/kea/files')
-rw-r--r--net-misc/kea/files/kea-confd-r110
-rw-r--r--net-misc/kea/files/kea-initd-r180
2 files changed, 90 insertions, 0 deletions
diff --git a/net-misc/kea/files/kea-confd-r1 b/net-misc/kea/files/kea-confd-r1
new file mode 100644
index 000000000000..ef7b2f49dd9d
--- /dev/null
+++ b/net-misc/kea/files/kea-confd-r1
@@ -0,0 +1,10 @@
+# Which services should be taken into account?
+DHCP4="true"
+DHCP6="false"
+DDNS="false"
+
+# Define your config files here. Otherwise we default to files in /etc/kea
+# (see init script)
+#DHCP4_CONFIG="/etc/kea/dhcp4.conf"
+#DHCP6_CONFIG="/etc/kea/dhcp6.conf"
+#DDNS_CONFIG="/etc/kea/ddns.conf"
diff --git a/net-misc/kea/files/kea-initd-r1 b/net-misc/kea/files/kea-initd-r1
new file mode 100644
index 000000000000..57711b3c9d36
--- /dev/null
+++ b/net-misc/kea/files/kea-initd-r1
@@ -0,0 +1,80 @@
+#!/sbin/openrc-run
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+description="kea dhcp services"
+
+dhcp4_command="/usr/sbin/kea-dhcp4"
+dhcp6_command="/usr/sbin/kea-dhcp6"
+ddns_command="/usr/sbin/kea-dhcp-ddns"
+dhcp4_config="${DHCP4_CONFIG:-/etc/kea/dhcp4.conf}"
+dhcp6_config="${DHCP6_CONFIG:-/etc/kea/dhcp6.conf}"
+ddns_config="${DDNS_CONFIG:-/etc/kea/ddns.conf}"
+dhcp4_pidfile="/run/kea-dhcp4.pid"
+dhcp6_pidfile="/run/kea-dhcp6.pid"
+ddns_pidfile="/run/kea-ddns.pid"
+
+depend() {
+ use net
+}
+
+start_pre() {
+ if [ ! -f "${config_file}" ] ; then
+ eerror "Please create a ${config_file} config file."
+ return 1
+ fi
+
+ if ${DHCP4:-false} ; then
+ if ! ${dhcp4_command} -t ${dhcp4_config} 1>/dev/null 2>/dev/null ; then
+ eerror "Error in config file ${dhcp4_config}"
+ return 1
+ fi
+ fi
+ if ${DHCP6:-false} ; then
+ if ! ${dhcp6_command} -t ${dhcp6_config} 1>/dev/null 2>/dev/null ; then
+ eerror "Error in config file ${dhcp6_config}"
+ return 1
+ fi
+ fi
+ if ${DDNS:-false} ; then
+ if ! ${ddns_command} -t ${ddns_config} 1>/dev/null 2>/dev/null ; then
+ eerror "Error in config file ${ddns_config}"
+ return 1
+ fi
+ fi
+}
+
+start() {
+ einfo "Starting kea dhcp services"
+ if ${DHCP4:-false} ; then
+ start-stop-daemon -m -b -p ${dhcp4_pidfile} \
+ -x ${dhcp4_command} -- -c ${dhcp4_config} \
+ || return 1
+ fi
+ if ${DHCP6:-false} ; then
+ start-stop-daemon -m -b -p ${dhcp6_pidfile} \
+ -x ${dhcp6_command} -- -c ${dhcp6_config} \
+ || return 1
+ fi
+ if ${DDNS:-false} ; then
+ start-stop-daemon -m -b -p ${ddns_pidfile} \
+ -x ${ddns_command} -- -c ${ddns_config} \
+ || return 1
+ fi
+}
+
+stop() {
+ einfo "Stopping kea dhcp services"
+ if ${DHCP4:-false} ; then
+ start-stop-daemon --stop -p ${dhcp4_pidfile} \
+ || return 1
+ fi
+ if ${DHCP6:-false} ; then
+ start-stop-daemon --stop -p ${dhcp6_pidfile} \
+ || return 1
+ fi
+ if ${DDNS:-false} ; then
+ start-stop-daemon --stop -p ${ddns_pidfile} \
+ || return 1
+ fi
+}