Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 Aug 2017 02:22:10 +0000
From:      Allan Jude <allanjude@freebsd.org>
To:        freebsd-doc@freebsd.org
Subject:   Re: FAQ section 10.17 : I cannot change the time on my system by more than one second! How do I get around this?
Message-ID:  <d6ba29e7-9354-d096-ff8d-1cea668978a0@freebsd.org>
In-Reply-To: <CAGxNqfD1hA_YK0WTRvdkP2Uy_7tcPOSuZ5_Y1jjT2SnXCpS76w@mail.gmail.com>
References:  <CAGxNqfD1hA_YK0WTRvdkP2Uy_7tcPOSuZ5_Y1jjT2SnXCpS76w@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 08/30/2017 05:37, Tarjei Jensen wrote:
> Hi,
> 
> Changing the time can be done by root executing /usr/sbin/ntpd. It will
> depend on the /etc/ntp.conf file having functioning ntp servers.
> 
> ntpd -n -g -g
> 
> will set the time and not fork (-n option). It logs to stdout or stderr and
> this output can be seen by the user. When the time and date is ok, use ^C
> to stop the program.
> 
> This command can be necessary with all computers that don't have a real
> time clock. e.g. The Raspberry PI computers. It may be worthwhile for
> owners to modify the startup script to start the ntpd daemon with the -g -g
> options as standard.
> 
> This is done by adding or modifying the ntpd_flags variable : in
> /etc/rc.d/ntpd
> 
> 
> The long term solution is to make sure ntpd is running as a daemon by
> modifying the /etc/rc.conf file and adding
> 
> ntpd_enable="YES"
> 
> ntpd can then be started on the command line with the command
> 
> service ntpd start
> 
> 
> Greetings,
> _______________________________________________
> freebsd-doc@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-doc
> To unsubscribe, send any mail to "freebsd-doc-unsubscribe@freebsd.org"
> 

That FAQ entry is about a different topic.

The limit for ntpd is 1000 seconds, but yes, will cause problems for
Raspberry Pi and other devices that cannot remember their clock.

The setting you are most likely looking for is:
ntpd_sync_on_start="YES"

in /etc/rc.conf, which adds the -g flag to ntpd.


-- 
Allan Jude



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?d6ba29e7-9354-d096-ff8d-1cea668978a0>