From owner-freebsd-bugs@FreeBSD.ORG Tue Mar 10 19:10:02 2009 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2ABB81065674 for ; Tue, 10 Mar 2009 19:10:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 05B908FC19 for ; Tue, 10 Mar 2009 19:10:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n2AJA1EJ091543 for ; Tue, 10 Mar 2009 19:10:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n2AJA1fj091542; Tue, 10 Mar 2009 19:10:01 GMT (envelope-from gnats) Resent-Date: Tue, 10 Mar 2009 19:10:01 GMT Resent-Message-Id: <200903101910.n2AJA1fj091542@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Josh Paetzel Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CFD4C10658B3 for ; Tue, 10 Mar 2009 19:05:00 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id BC54A8FC14 for ; Tue, 10 Mar 2009 19:05:00 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n2AJ503X021862 for ; Tue, 10 Mar 2009 19:05:00 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id n2AJ50qd021861; Tue, 10 Mar 2009 19:05:00 GMT (envelope-from nobody) Message-Id: <200903101905.n2AJ50qd021861@www.freebsd.org> Date: Tue, 10 Mar 2009 19:05:00 GMT From: Josh Paetzel To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: conf/132515: ntpd_sync_on_start option in /etc/rc.conf misbehaves X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Mar 2009 19:10:02 -0000 >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: