[OpenWrt-Devel] [PATCH] sysfixtime and ntpd conflict

John Crispin blogic at openwrt.org
Tue Feb 16 12:41:40 EST 2016


Hi,

NAK for various reasons

* bad/missing subject prefix
* the description is not very verbose and the first sentence has bad grammar
* most importantly, this bug needs to be fixed inside ntpd rather than
adding a hackish work around to a init.d script

have you analyzed what goes wrong inside ntpd ?

	John



On 15/02/2016 22:29, Mark Andrews wrote:
> The sysfixtime script can cause ntpd to stop setting managing the time.
> This patch ensures that ntpd is restarted after the time is changed by sysfixtime.
> ---
> package/base-files/files/etc/init.d/sysfixtime | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/package/base-files/files/etc/init.d/sysfixtime b/package/base-files/files/etc/init.d/sysfixtime
> index ab946f6..87813ea 100755
> --- a/package/base-files/files/etc/init.d/sysfixtime
> +++ b/package/base-files/files/etc/init.d/sysfixtime
> @@ -10,9 +10,12 @@ HWCLOCK=/sbin/hwclock
> boot() {
> 	start && exit 0
> 
> -	local curtime="$(date +%s)"
> 	local maxtime="$(find /etc -type f -exec date -r {} +%s \; | sort -nr | head -n1)"
> -	[ $curtime -lt $maxtime ] && date -s @$maxtime
> +	local curtime="$(date +%s)"
> +	if [ $curtime -lt $maxtime ]; then
> +		date -s @$maxtime
> +		/etc/init.d/sysntpd restart
> +	fi
> }
> 
> start() {
> 
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list