@@ -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
@@ -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
@@ -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
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. [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 <yi.zhao@windriver.com> --- .../kea/files/kea-dhcp-ddns-server | 16 ++++++++++------ .../kea/files/kea-dhcp4-server | 16 ++++++++++------ .../kea/files/kea-dhcp6-server | 16 ++++++++++------ 3 files changed, 30 insertions(+), 18 deletions(-)