openwrtv3/package/base-files/files/etc
Jo-Philipp Wich 3c4165a305 enable ntpd server for busybox
hi

Another version, in this one the enable_server option is in the timeserver ntp part of the "system" config file
You can patch trunk and bacfire (tested both)
You can put busybox ntpd in client mode (if you put server), in client & server (by putting enable_server to 1, ntpd listen to udp 123), and also in server mode only (if you didn't put any servers in the config and still put enable_server 1,  ntpd will answer with the time of the router)

I've replaced "config_foreach getpeers timeserver" with "config_get peers ntp server" because we want ntp timeserver, not random ones (to pre-answer if someone want to say that it's intrusive ...)

 Signed-off-by: Etienne CHAMPETIER <etienne.champetier@free.fr>

Le 27/03/2012 20:41, Etienne Champetier a écrit :
> I've now tested my trunk patch and it works fine
> But I still can't find were $PROG is defined (is this a mistake, or some sort of built in variable???)
> (I've made some grep and nothing)
>
> Le 23/03/2012 02:19, Philip Prindeville a écrit :
>> Maybe:
>>
>> [ -n "$PROG" -a -x "$PROG" ] || return 1
>>
>> instead?
>>
>>
>> On 3/22/12 4:34 PM, Etienne Champetier wrote:
>>> Hi
>>>
>>> The 2 attached patchs (trunk & bacfire) add busybox ntpd enable_server option, as busybox ntpd server is compiled by default.
>>> We only need 1 client/server daemon (olipro patch was launching 2 daemons)
>>> I've fully tested the bacfire patch, and as i don't have a running openwrt trunk i'm not sure for the trunk patch (i'm sure about my modifications, but i'm not sure about "[ -x $PROG ] || return 1", as "$PROG" isn't defined ?!)
>>>
>>> Signed-off-by: Etienne CHAMPETIER <etienne.champetier@free.fr>
>>>
>>>
>>> Le 16/01/2012 01:57, Philip Prindeville a écrit :
>>>> On 1/14/12 11:37 AM, Olipro wrote:
>>>>> On Saturday 14 Jan 2012 02:45:59 Philip Prindeville wrote:
>>>>>> Don't we already have a 'disabled' option?  Now we're adding an
>>>>>> 'enable_server' option?
>>>>>>
>>>>>> That seems confusing for no useful reason.
>>>>>>
>>>>> have you bothered to read what I originally wrote? your response would make
>>>>> me inclined to believe that you didn't.
>>>>>
>>>>> currently the ntpd initscript only runs it as a CLIENT - this patch enables
>>>>> you to have one instance running as a client and another as a SERVER that
>>>>> other hosts can synchronise with.
>>>>>
>>>>> Or perhaps I'm misunderstanding, what would you propose for allowing the
>>>>> built-in busybox ntpd to be utilised as a server? a separate init script
>>>>> entirely perhaps?
>>>> Or separate config sections... instead of 'config ntp' have 'config ntp-server' and 'config ntp-client'.
>>>>
>>>> -Philip
>>>>
>>>>
>>>> _______________________________________________
>>>> openwrt-devel mailing list
>>>> openwrt-devel@lists.openwrt.org
>>>> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
>> _______________________________________________
>> openwrt-devel mailing list
>> openwrt-devel@lists.openwrt.org
>> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel

SVN-Revision: 31374
2012-04-20 15:05:38 +00:00
..
config enable ntpd server for busybox 2012-04-20 15:05:38 +00:00
hotplug.d base-files: remove rdate integration, add busybox ntpd init script and server list in /etc/config/system The rdate applet proved to be too unreliable to obtain the current time on boot: - public time servers are rare and often unreachable or overloaded - rdate does not daemonize, it needs a network connection the moment it is started, leading to race conditions - the /etc/config/timeserver configuration is overly complex and there is no reliable way to disable rdate invocations - the time protocol as specified in RFC 868 is considered obsolete This commit adds an init script /etc/init.d/sysntpd which starts and stops the busybox ntpd accordingly. The builtin ntpd can be disabled by either disabling the init script, removing the symlink to busybox or by clearing the timeserver list in /etc/config/system. 2011-10-27 00:21:53 +00:00
init.d enable ntpd server for busybox 2012-04-20 15:05:38 +00:00
uci-defaults base-files: add a uci-defaults script which will migrate the root password to /etc/shadow if needed 2012-01-22 22:25:42 +00:00
banner base-files: reformat banner to better work with varying version string lengths, do not set image options if menu is disabled (#11280) 2012-04-15 15:21:55 +00:00
diag.sh base-files: make diag.sh stub working in bash 2009-04-30 21:00:57 +00:00
functions.sh package/base-files: move /etc/functions.sh to /lib/functions.sh 2011-11-08 14:14:29 +00:00
group base-files: add an ftp group as well 2011-03-13 19:04:32 +00:00
hosts base_files: Remove . from end of localhost entry 2010-08-06 08:00:40 +00:00
hotplug2-common.rules base-files: process platform hotplug calls in the early launch of hotplug2 to avoid having crda calls get stuck at boot time (fixes #10350, #10354) 2011-11-05 17:16:01 +00:00
hotplug2-init.rules hotplug2: Use stricter matching for rule regular expressions 2011-02-01 16:37:53 +00:00
inittab nuke another 2.4 skeleton 2011-11-10 13:39:06 +00:00
openwrt_release include, base-files, opkg: introduce version configuration to override the embedded version info of generated images - Introduce new Kconfig symbols VERSION_DIST, VERSION_NICK, VERSION_NUMBER and VERSION_REPO to specify distribution, release name, version and repository for a given build - Introduce include/version.mk to provide common helpers for packages dealing with versions - Make opkg use version.mk to populate the opkg.conf template - Make base-files use version.mk to populate /etc/openwrt_version, /etc/openwrt_release and /etc/banner 2012-04-12 17:31:16 +00:00
openwrt_version include, base-files, opkg: introduce version configuration to override the embedded version info of generated images - Introduce new Kconfig symbols VERSION_DIST, VERSION_NICK, VERSION_NUMBER and VERSION_REPO to specify distribution, release name, version and repository for a given build - Introduce include/version.mk to provide common helpers for packages dealing with versions - Make opkg use version.mk to populate the opkg.conf template - Make base-files use version.mk to populate /etc/openwrt_version, /etc/openwrt_release and /etc/banner 2012-04-12 17:31:16 +00:00
passwd base-files: prime root password with "x" to notify programs that there is a shadow record, fix /bin/login.sh password detection accordingly. Solves broken key based dropbear login with empty password after r28935. 2011-11-14 19:02:01 +00:00
preinit base-files: preinit: Fixed sourcing of diag.sh in /etc/preinit. This caused errors due to frequent use of /proc/cpuinfo to determine board name to pick led layout. Now diag.sh (which only defines set_state and any helper functions) is sourced by a proper preinit function during preinit_main, which is after /proc has been brought up, unlike in /etc/preinit 2011-07-07 02:52:02 +00:00
profile base-files: fix arp() procedure to properly detect /usr/bin/arp 2011-08-12 14:34:39 +00:00
protocols rename default/ to files/ 2006-11-22 23:30:57 +00:00
rc.common base-files: split service related functions off to /lib/functions/service.sh 2012-03-20 14:29:50 +00:00
rc.local base-files: introduce a ready-to-use /etc/rc.local to let users run custom commands on init without creating custom init scripts 2009-09-11 21:35:03 +00:00
services Add munin to /etc/services 2012-03-18 19:41:57 +00:00
shells rename default/ to files/ 2006-11-22 23:30:57 +00:00
sysctl.conf base-files: enable conntrack accounting in sysctl. It used to be a compile time option which got deprecated 2012-03-04 14:53:17 +00:00
sysupgrade.conf base-files: - add sysupgrade support for keepfile hints * introduces /lib/upgrade/keep.d/ for per-package keepfile lists * introduces /etc/sysupgrade.conf for user defined keepfile hints - prime /lib/upgrade/keep.d/base-files-essential to keep sysupgrade usable for images without opkg - change sysupgrade to build the keepfile list from /lib/upgrade/keep.d/, /etc/sysupgrade.conf and opkg list-changed-conffiles 2010-10-05 19:24:12 +00:00