summaryrefslogtreecommitdiffstats
path: root/meta/recipes-connectivity/kea/files
diff options
context:
space:
mode:
authorakuster <akuster808@gmail.com>2020-10-14 22:48:31 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-10-17 12:34:29 +0100
commitd4ecc90268438900ccbef6020cdb15c054fb4027 (patch)
tree5e90660082b80f65467f53e36c5389d5991d0c90 /meta/recipes-connectivity/kea/files
parent044b20737a6b4647852637437a5c97a17274cea8 (diff)
downloadpoky-d4ecc90268438900ccbef6020cdb15c054fb4027.tar.gz
kea: add init scripts
[ Yocto # 14074 ] Add init scripts for dhcp4,6 and ddns (From OE-Core rev: 6d20bfda696fc6c6c3989ecf9996d2494953e232) 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')
-rw-r--r--meta/recipes-connectivity/kea/files/fix_pid_keactrl.patch22
-rw-r--r--meta/recipes-connectivity/kea/files/kea-dhcp-ddns-server46
-rw-r--r--meta/recipes-connectivity/kea/files/kea-dhcp4-server46
-rw-r--r--meta/recipes-connectivity/kea/files/kea-dhcp6-server47
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 @@
1Busybox does not support ps -p so use pgrep
2
3Upstream-Status: Inappropriate [embedded specific]
4Based on changes from Diego Sueiro <Diego.Sueiro@arm.com>
5
6Signed-off-by: Armin kuster <akuster808@gmail.com>
7
8Index: kea-1.7.10/src/bin/keactrl/keactrl.in
9===================================================================
10--- kea-1.7.10.orig/src/bin/keactrl/keactrl.in
11+++ kea-1.7.10/src/bin/keactrl/keactrl.in
12@@ -137,8 +137,8 @@ check_running() {
13 # Get the PID from the PID file (if it exists)
14 get_pid_from_file "${proc_name}"
15 if [ ${_pid} -gt 0 ]; then
16- # Use ps to check if PID is alive
17- ps -p ${_pid} 1>/dev/null
18+ # Use pgrep and grep to check if PID is alive
19+ pgrep -v 1 | grep ${_pid} 1>/dev/null
20 retcode=$?
21 if [ $retcode -eq 0 ]; then
22 # 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 @@
1#!/bin/sh
2### BEGIN INIT INFO
3# Provides: kea-dhcp-ddns-server
4# Required-Start: $local_fs $network $remote_fs $syslog
5# Required-Stop: $local_fs $network $remote_fs $syslog
6# Default-Start: 2 3 4 5
7# Default-Stop: 0 1 6
8# Short-Description: ISC KEA DHCP IPv6 Server
9### END INIT INFO
10
11PATH=/sbin:/usr/sbin:/bin:/usr/bin
12DESC="kea-dhcp-ddns-server"
13NAME=kea-dhcp-ddns
14DAEMON=/usr/sbin/keactrl
15DAEMON_ARGS=" -s dhcp_ddns"
16
17set -e
18
19# Exit if the package is not installed
20[ -x "$DAEMON" ] || exit 0
21
22# Source function library.
23. /etc/init.d/functions
24
25case "$1" in
26 start)
27 echo -n "Starting $DESC: "
28 start-stop-daemon -S -b -n $NAME -x $DAEMON -- start $DAEMON_ARGS
29 echo "done."
30 ;;
31 stop)
32 echo -n "Stopping $DESC: "
33 kpid=`pidof $NAME`
34 kill $kpid
35 echo "done."
36 ;;
37 restart|force-reload)
38 #
39 $0 stop
40 $0 start
41 ;;
42 *)
43 echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
44 exit 1
45 ;;
46esac
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 @@
1#!/bin/sh
2### BEGIN INIT INFO
3# Provides: kea-dhcp4-server
4# Required-Start: $local_fs $network $remote_fs $syslog
5# Required-Stop: $local_fs $network $remote_fs $syslog
6# Default-Start: 2 3 4 5
7# Default-Stop: 0 1 6
8# Short-Description: ISC KEA DHCP IPv6 Server
9### END INIT INFO
10
11PATH=/sbin:/usr/sbin:/bin:/usr/bin
12DESC="kea-dhcp4-server"
13NAME=kea-dhcp4
14DAEMON=/usr/sbin/keactrl
15DAEMON_ARGS=" -s dhcp4"
16
17set -e
18
19# Exit if the package is not installed
20[ -x "$DAEMON" ] || exit 0
21
22# Source function library.
23. /etc/init.d/functions
24
25case "$1" in
26 start)
27 echo -n "Starting $DESC: "
28 start-stop-daemon -S -b -n $NAME -x $DAEMON -- start $DAEMON_ARGS
29 echo "done."
30 ;;
31 stop)
32 echo -n "Stopping $DESC: "
33 kpid=`pidof $NAME`
34 kill $kpid
35 echo "done."
36 ;;
37 restart|force-reload)
38 #
39 $0 stop
40 $0 start
41 ;;
42 *)
43 echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
44 exit 1
45 ;;
46esac
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 @@
1#!/bin/sh
2### BEGIN INIT INFO
3# Provides: kea-dhcp6-server
4# Required-Start: $local_fs $network $remote_fs $syslog
5# Required-Stop: $local_fs $network $remote_fs $syslog
6# Default-Start: 2 3 4 5
7# Default-Stop: 0 1 6
8# Short-Description: ISC KEA DHCP IPv6 Server
9### END INIT INFO
10
11# PATH should only include /usr/* if it runs after the mountnfs.sh script
12PATH=/sbin:/usr/sbin:/bin:/usr/bin
13DESC="kea-dhcp6-server"
14NAME=kea-dhcp6
15DAEMON=/usr/sbin/keactrl
16DAEMON_ARGS=" -s dhcp6"
17
18set -e
19
20# Exit if the package is not installed
21[ -x "$DAEMON" ] || exit 0
22
23# Source function library.
24. /etc/init.d/functions
25
26case "$1" in
27 start)
28 echo -n "Starting $DESC: "
29 start-stop-daemon -S -b -n $NAME -x $DAEMON -- start $DAEMON_ARGS
30 echo "done."
31 ;;
32 stop)
33 echo -n "Stopping $DESC: "
34 kpid=`pidof $NAME`
35 kill $kpid
36 echo "done."
37 ;;
38 restart|force-reload)
39 #
40 $0 stop
41 $0 start
42 ;;
43 *)
44 echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
45 exit 1
46 ;;
47esac