diff options
author | akuster <akuster808@gmail.com> | 2020-10-14 22:48:31 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-10-17 12:33:30 +0100 |
commit | 6d20bfda696fc6c6c3989ecf9996d2494953e232 (patch) | |
tree | f8f63de49bc77b00490a7c36b8ddd80819046574 /meta/recipes-connectivity/kea/files | |
parent | a288c0f440b0e3f63213798ec977a3b44339764b (diff) | |
download | openembedded-core-contrib-6d20bfda696fc6c6c3989ecf9996d2494953e232.tar.gz |
kea: add init scripts
[ Yocto # 14074 ]
Add init scripts for dhcp4,6 and ddns
Signed-off-by: Armin kuster <akuster808@gmail.com>
--
V2]
remove 'status' from usage
add patch to fix ps -p in keactrl.in
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-connectivity/kea/files')
4 files changed, 161 insertions, 0 deletions
diff --git a/meta/recipes-connectivity/kea/files/fix_pid_keactrl.patch b/meta/recipes-connectivity/kea/files/fix_pid_keactrl.patch new file mode 100644 index 0000000000..eeeb89942b --- /dev/null +++ b/meta/recipes-connectivity/kea/files/fix_pid_keactrl.patch @@ -0,0 +1,22 @@ +Busybox does not support ps -p so use pgrep + +Upstream-Status: Inappropriate [embedded specific] +Based on changes from Diego Sueiro <Diego.Sueiro@arm.com> + +Signed-off-by: Armin kuster <akuster808@gmail.com> + +Index: kea-1.7.10/src/bin/keactrl/keactrl.in +=================================================================== +--- kea-1.7.10.orig/src/bin/keactrl/keactrl.in ++++ kea-1.7.10/src/bin/keactrl/keactrl.in +@@ -137,8 +137,8 @@ check_running() { + # Get the PID from the PID file (if it exists) + get_pid_from_file "${proc_name}" + if [ ${_pid} -gt 0 ]; then +- # Use ps to check if PID is alive +- ps -p ${_pid} 1>/dev/null ++ # Use pgrep and grep to check if PID is alive ++ pgrep -v 1 | grep ${_pid} 1>/dev/null + retcode=$? + if [ $retcode -eq 0 ]; then + # No error, so PID IS ALIVE diff --git a/meta/recipes-connectivity/kea/files/kea-dhcp-ddns-server b/meta/recipes-connectivity/kea/files/kea-dhcp-ddns-server new file mode 100644 index 0000000000..50fe40d439 --- /dev/null +++ b/meta/recipes-connectivity/kea/files/kea-dhcp-ddns-server @@ -0,0 +1,46 @@ +#!/bin/sh +### BEGIN INIT INFO +# Provides: kea-dhcp-ddns-server +# Required-Start: $local_fs $network $remote_fs $syslog +# Required-Stop: $local_fs $network $remote_fs $syslog +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: ISC KEA DHCP IPv6 Server +### END INIT INFO + +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" + +set -e + +# Exit if the package is not installed +[ -x "$DAEMON" ] || exit 0 + +# Source function library. +. /etc/init.d/functions + +case "$1" in + start) + echo -n "Starting $DESC: " + start-stop-daemon -S -b -n $NAME -x $DAEMON -- start $DAEMON_ARGS + echo "done." + ;; + stop) + echo -n "Stopping $DESC: " + kpid=`pidof $NAME` + kill $kpid + echo "done." + ;; + restart|force-reload) + # + $0 stop + $0 start + ;; + *) + echo "Usage: $SCRIPTNAME {start|stop|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 new file mode 100644 index 0000000000..e83e51025d --- /dev/null +++ b/meta/recipes-connectivity/kea/files/kea-dhcp4-server @@ -0,0 +1,46 @@ +#!/bin/sh +### BEGIN INIT INFO +# Provides: kea-dhcp4-server +# Required-Start: $local_fs $network $remote_fs $syslog +# Required-Stop: $local_fs $network $remote_fs $syslog +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: ISC KEA DHCP IPv6 Server +### END INIT INFO + +PATH=/sbin:/usr/sbin:/bin:/usr/bin +DESC="kea-dhcp4-server" +NAME=kea-dhcp4 +DAEMON=/usr/sbin/keactrl +DAEMON_ARGS=" -s dhcp4" + +set -e + +# Exit if the package is not installed +[ -x "$DAEMON" ] || exit 0 + +# Source function library. +. /etc/init.d/functions + +case "$1" in + start) + echo -n "Starting $DESC: " + start-stop-daemon -S -b -n $NAME -x $DAEMON -- start $DAEMON_ARGS + echo "done." + ;; + stop) + echo -n "Stopping $DESC: " + kpid=`pidof $NAME` + kill $kpid + echo "done." + ;; + restart|force-reload) + # + $0 stop + $0 start + ;; + *) + echo "Usage: $SCRIPTNAME {start|stop|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 new file mode 100644 index 0000000000..10f2d22641 --- /dev/null +++ b/meta/recipes-connectivity/kea/files/kea-dhcp6-server @@ -0,0 +1,47 @@ +#!/bin/sh +### BEGIN INIT INFO +# Provides: kea-dhcp6-server +# Required-Start: $local_fs $network $remote_fs $syslog +# Required-Stop: $local_fs $network $remote_fs $syslog +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: ISC KEA DHCP IPv6 Server +### END INIT INFO + +# PATH should only include /usr/* if it runs after the mountnfs.sh script +PATH=/sbin:/usr/sbin:/bin:/usr/bin +DESC="kea-dhcp6-server" +NAME=kea-dhcp6 +DAEMON=/usr/sbin/keactrl +DAEMON_ARGS=" -s dhcp6" + +set -e + +# Exit if the package is not installed +[ -x "$DAEMON" ] || exit 0 + +# Source function library. +. /etc/init.d/functions + +case "$1" in + start) + echo -n "Starting $DESC: " + start-stop-daemon -S -b -n $NAME -x $DAEMON -- start $DAEMON_ARGS + echo "done." + ;; + stop) + echo -n "Stopping $DESC: " + kpid=`pidof $NAME` + kill $kpid + echo "done." + ;; + restart|force-reload) + # + $0 stop + $0 start + ;; + *) + echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 + exit 1 + ;; +esac |