Busybox currently has an ntpd, but the initscript currently only starts up a client version; a small modification is needed to start up an additional daemon that can operate as a server.
Signed-off-by: Oliver Smith <oli...@8.c.9.b.0.7.4.0.1.0.0.2.ip6.arpa>
Index: package/base-files/files/etc/init.d/sysntpd =================================================================== --- package/base-files/files/etc/init.d/sysntpd (revision 29667) +++ package/base-files/files/etc/init.d/sysntpd (working copy) @@ -11,6 +11,7 @@ [ -x $PROG ] || return 1 local peers + local enable_server getpeers() { config_get peers "$1" server @@ -18,6 +19,7 @@ config_load system config_foreach getpeers timeserver + config_get_bool enable_server ntp enable_server 0 if [ -n "$peers" ]; then local peer @@ -28,8 +30,19 @@ service_start /usr/sbin/ntpd $args fi + + if [ $enable_server -ne 0 ]; then + SERVICE_PID_FILE=/var/run/ntpdsrv.pid + local args="-n -l" + service_start /usr/sbin/ntpd $args + fi + } stop() { service_stop /usr/sbin/ntpd + if [ -e /var/run/ntpdsrv.pid ]; then + SERVICE_PID_FILE=/var/run/ntpdsrv.pid + service_stop /usr/sbin/ntpd + fi } Index: package/base-files/files/etc/config/system =================================================================== --- package/base-files/files/etc/config/system (revision 29667) +++ package/base-files/files/etc/config/system (working copy) @@ -7,3 +7,4 @@ list server 1.openwrt.pool.ntp.org list server 2.openwrt.pool.ntp.org list server 3.openwrt.pool.ntp.org + option enable_server 0
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel