Date: Tue, 10 Mar 2009 19:05:00 GMT From: Josh Paetzel <jpaetzel@FreeBSD.org> To: freebsd-gnats-submit@FreeBSD.org Subject: conf/132515: ntpd_sync_on_start option in /etc/rc.conf misbehaves Message-ID: <200903101905.n2AJ50qd021861@www.freebsd.org> Resent-Message-ID: <200903101910.n2AJA1fj091542@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 132515 >Category: conf >Synopsis: ntpd_sync_on_start option in /etc/rc.conf misbehaves >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Mar 10 19:10:01 UTC 2009 >Closed-Date: >Last-Modified: >Originator: Josh Paetzel >Release: 6.4-RELEASE >Organization: Prometheus Research >Environment: FreeBSD virt.tcbug.org 6.4-RELEASE FreeBSD 6.4-RELEASE #0: Mon Dec 22 01:35:53 UTC 2008 jpaetzel@virt.tcbug.org:/usr/obj/usr/src/sys/VIRT amd64 >Description: Setting ntpd_sync_on_start="YES" in /etc/rc.conf is not a drop in replacement for the depricated ntpdate In order to mimic ntpdate's functiomnality, ntpd needs to be started with the -q -x -g flags, which causes it to exit. As the rc script stands, ntpd_sync_on_start="YES" only adds -g to ntpd's startup >How-To-Repeat: ntpd_enable="YES" ntpd_sync_on_start="YES" in /etc/rc.conf then slew your time way off then reboot ntpd will be started on boot, but won't have synced the time up correctly >Fix: As a very naive fix, and more of a proof of concept thing, I tried... --- /etc/rc.d/ntpd 2008-11-28 11:54:08.000000000 -0600 +++ ntpd 2009-03-10 07:05:46.000000000 -0500 @@ -4,8 +4,7 @@ # # PROVIDE: ntpd -# REQUIRE: DAEMON ntpdate cleanvar devfs -# BEFORE: LOGIN +# REQUIRE: mount_gbde # KEYWORD: nojail . /etc/rc.subr @@ -23,7 +22,8 @@ rc_flags="-c ${ntpd_config} ${ntpd_flags}" if checkyesno ntpd_sync_on_start; then - rc_flags="-g $rc_flags" + #rc_flags="-g $rc_flags" + ntpd -g -q -x fi if [ -z "$ntpd_chrootdir" ]; then Ignore the REQUIRE changes, the problem and fix was verified on a stock 6.4, I just didn't have access to that box when I wrote this. >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200903101905.n2AJ50qd021861>