Ntpd config file support

Laszlo Papp lpapp at kde.org
Tue Mar 18 19:01:12 UTC 2014


On Tue, Mar 18, 2014 at 6:51 PM, Harald Becker <ralda at gmx.de> wrote:
> if usage of an applet is
> unclear, just ask ... if you need help to setup required
> scripts, just ask ...

Let us see if we can more productive then!

How about the following two files:

diff --git a/meta/recipes-core/busybox/files/busybox-ntpd
b/meta/recipes-core/busybox/files/busybox-ntpd
new file mode 100644
index 0000000..3e0b32d
--- /dev/null
+++ b/meta/recipes-core/busybox/files/busybox-ntpd
@@ -0,0 +1,39 @@
+#!/bin/sh
+DAEMON=/sbin/ntpd
+NAME=ntpd
+DESC="Busybox NTP Daemon"
+source /etc/busybox-ntp.conf
+ARGS="-p $PEER"
+
+test -f $DAEMON || exit 0
+
+set -e
+
+case "$1" in
+    start)
+        start-stop-daemon -S -b -n $NAME -a $DAEMON -- $ARGS
+        echo "done."
+        ;;
+    stop)
+        echo -n "stopping $DESC: $NAME... "
+        start-stop-daemon -K -n $NAME
+        echo "done."
+        ;;
+    restart)
+        echo "restarting $DESC: $NAME... "
+        $0 stop
+        $0 start
+        echo "done."
+        ;;
+    reload)
+        echo -n "reloading $DESC: $NAME... "
+        killall -HUP $(basename ${DAEMON})
+        echo "done."
+        ;;
+    *)
+        echo "Usage: $0 {start|stop|restart|reload}"
+        exit 1
+        ;;
+esac
+
+exit 0
diff --git a/meta/recipes-core/busybox/files/busybox-ntpd.conf
b/meta/recipes-core/busybox/files/busybox-ntpd.conf
new file mode 100644
index 0000000..a1470ef
--- /dev/null
+++ b/meta/recipes-core/busybox/files/busybox-ntpd.conf
@@ -0,0 +1 @@
+export PEER=127.0.0.1


More information about the busybox mailing list