From turutani@polymer3.scphys.kyoto-u.ac.jp  Sat Apr  9 13:58:19 2005
Return-Path: <turutani@polymer3.scphys.kyoto-u.ac.jp>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 17A0716A4CF
	for <FreeBSD-gnats-submit@freebsd.org>; Sat,  9 Apr 2005 13:58:19 +0000 (GMT)
Received: from polymer3.scphys.kyoto-u.ac.jp (polymer3.scphys.kyoto-u.ac.jp [130.54.56.153])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 6577943D53
	for <FreeBSD-gnats-submit@freebsd.org>; Sat,  9 Apr 2005 13:58:18 +0000 (GMT)
	(envelope-from turutani@polymer3.scphys.kyoto-u.ac.jp)
Received: from polymer3.scphys.kyoto-u.ac.jp (localhost [127.0.0.1])
	by polymer3.scphys.kyoto-u.ac.jp (8.13.3/8.13.3/20030426-1) with ESMTP id j39DwHlr092219;
	Sat, 9 Apr 2005 22:58:17 +0900 (JST)
	(envelope-from turutani@polymer3.scphys.kyoto-u.ac.jp)
Received: (from turutani@localhost)
	by polymer3.scphys.kyoto-u.ac.jp (8.13.3/8.13.1/Submit) id j39DwHOu092218;
	Sat, 9 Apr 2005 22:58:17 +0900 (JST)
	(envelope-from turutani)
Message-Id: <200504091358.j39DwHOu092218@polymer3.scphys.kyoto-u.ac.jp>
Date: Sat, 9 Apr 2005 22:58:17 +0900 (JST)
From: Tsurutani Naoki <turutani@scphys.kyoto-u.ac.jp>
Reply-To: Tsurutani Naoki <turutani@scphys.kyoto-u.ac.jp>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: ntpdate in startup sequence fails.
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         79712
>Category:       conf
>Synopsis:       ntpdate in startup sequence fails.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    keramida
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Apr 09 14:00:52 GMT 2005
>Closed-Date:    Wed Jul 27 11:53:40 GMT 2005
>Last-Modified:  Wed Jul 27 11:53:40 GMT 2005
>Originator:     Tsurutani Naoki
>Release:        FreeBSD 5.4-STABLE i386
>Organization:
>Environment:
System: FreeBSD polymer3.scphys.kyoto-u.ac.jp 5.4-STABLE FreeBSD 5.4-STABLE #2: Wed Apr 6 17:28:53 JST 2005 root@polymer3.scphys.kyoto-u.ac.jp:/usr/local/work/usr/obj/usr/src/sys/POLYMER i386


	
>Description:
	in /etc/rc.conf, ntpdate_flags like
		ntpdate_enable="YES"
		ntpdate_flags="-t 5 -sb ntp.example.com"
	are ignored.
	host in /etc/ntp.conf are used instead.
	
>How-To-Repeat:
	booting with above options and with /etc/ntp.conf being.
	
>Fix:
	according to /etc/rc.d/ntpdate, "ntpdate_hosts" variable is used
	to dicide host to access, but it is not defined by default nor be
	mentioned in man pages.
	if one set ntp server host in "ntpdate_flags" variable, it might be
	ignored or ntpdate will be ran with 2 target hosts.
	it's curious, i think. /etc/ntp.conf should be independent on ntpdate
	and vice versa, for some servers are not suitable while boot sequence
	even if they are marked as "prefer".
	if currently way of running ntpdate is still used, fix documents
	about ntpdate, ntp.conf, ntpd, and rc.conf, and fix default/rc.conf.
	


>Release-Note:
>Audit-Trail:

From: Matteo Riondato <rionda@gufi.org>
To: bug-followup@FreeBSD.org, turutani@scphys.kyoto-u.ac.jp
Cc:  
Subject: Re: conf/79712: ntpdate in startup sequence fails.
Date: Tue, 7 Jun 2005 22:07:49 +0200

 I think the only file that need to be fixed is /etc/rc.conf
 Patch follows:
 --- rc.conf.old Tue Jun  7 21:52:17 2005
 +++ rc.conf     Tue Jun  7 22:01:29 2005
 @@ -229,6 +229,7 @@
  ntpdate_enable="NO"            # Run ntpdate to sync time on boot (or NO).
  ntpdate_program="/usr/sbin/ntpdate"    # path to ntpdate, if you want a different one.
  ntpdate_flags="-b"             # Flags to ntpdate (if enabled).
 +ntpdate_hosts=""               # NTP servers for ntpdate. They will be read from /etc/ntp.conf if available.
  ntpd_enable="NO"               # Run ntpd Network Time Protocol (or NO).
  ntpd_program="/usr/sbin/ntpd"  # path to ntpd, if you want a different one.
  ntpd_sync_on_start="NO"                # Sync time on ntpd startup, even if offset is high
 
 Best Regards
 -- 
 Rionda aka Matteo Riondato
 G.U.F.I. Staff Member (http://www.gufi.org)
 FreeSBIE Developer (http://www.freesbie.org)

From: Tsurutani Naoki <turutani@scphys.kyoto-u.ac.jp>
To: Matteo Riondato <rionda@gufi.org>
Cc: bug-followup@FreeBSD.org
Subject: Re: conf/79712: ntpdate in startup sequence fails.
Date: Wed, 08 Jun 2005 12:31:53 +0900

 In that way, 'test -z "$ntpdate_hosts"' in /etc/rc.d/ntpdate is still true,
 therefore /etc/ntp.conf will be read to obtain "ntpdate_hosts".
 
 Please add default entry to /etc/default/rc.conf,
 and write the comment into manpage of rc.conf(5).
 It is better to add comments into manpage of ntp.conf(5),
 for it might be read unlikely.
 
 Sincerely
 
 ---
 Tsurutani Naoki (turutani@scphys.kyoto-u.ac.jp)

From: Matteo Riondato <rionda@gufi.org>
To: Tsurutani Naoki <turutani@scphys.kyoto-u.ac.jp>
Cc: bug-followup@FreeBSD.org
Subject: Re: conf/79712: ntpdate in startup sequence fails.
Date: Wed, 8 Jun 2005 08:09:14 +0200

 > In that way, 'test -z "$ntpdate_hosts"' in /etc/rc.d/ntpdate is still true,
 > therefore /etc/ntp.conf will be read to obtain "ntpdate_hosts".
 > Please add default entry to /etc/default/rc.conf,
 
 Yes, you're right.
 It seems to me that using "pool.ntp.org" as a default entry would be ok 
 (and is sort of suggested on www.ntp.org).
 
 > and write the comment into manpage of rc.conf(5).
 
 ntpdate_hosts is already documented in rc.conf(5)
 
 > It is better to add comments into manpage of ntp.conf(5),
 > for it might be read unlikely.
 
 Patch follows.
 
 --- ntp.conf.5.old      Wed Jun  8 07:57:46 2005
 +++ ntp.conf.5  Wed Jun  8 08:05:47 2005
 @@ -24,6 +24,13 @@
  .Fl c
  command line option).
  .Pp
 +The
 +.Pa /etc/rc.d/ntpdate 
 +script reads this file to get a list of NTP servers 
 +to use if the variable 'ntpdate_hosts' was not declared.
 +Refer to the 
 +.Xr rc.conf 5 man page for further info about this.
 +.Pp
  The file format is similar to other
  .Ux
  configuration files.
 
 Best Regards
 -- 
 Rionda aka Matteo Riondato
 G.U.F.I. Staff Member (http://www.gufi.org)
 FreeSBIE Developer (http://www.freesbie.org)

From: Tsurutani Naoki <turutani@scphys.kyoto-u.ac.jp>
To: Matteo Riondato <rionda@gufi.org>
Cc: bug-followup@FreeBSD.org
Subject: Re: conf/79712: ntpdate in startup sequence fails.
Date: Wed, 08 Jun 2005 17:58:34 +0900

 >ntpdate_hosts is already documented in rc.conf(5)
 
 Sorry, I missed it.
 
 >Patch follows.
 
 Thank you for your patch.  It's nice.
 
 Sincerely
 
 ---
 Tsurutani Naoki (turutani@scphys.kyoto-u.ac.jp)
State-Changed-From-To: open->patched 
State-Changed-By: keramida 
State-Changed-When: Thu Jun 9 11:26:08 GMT 2005 
State-Changed-Why:  
Slightly modified mdoc patch committed to HEAD. 
Thanks to both of you :-) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=79712 
Responsible-Changed-From-To: freebsd-bugs->keramida 
Responsible-Changed-By: keramida 
Responsible-Changed-When: Thu Jun 9 11:27:00 GMT 2005 
Responsible-Changed-Why:  
Grab this PR so I'm reminded to MFC it later. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=79712 
State-Changed-From-To: patched->closed 
State-Changed-By: keramida 
State-Changed-When: Wed Jul 27 11:53:26 GMT 2005 
State-Changed-Why:  
Merged to 5.X 

http://www.freebsd.org/cgi/query-pr.cgi?pr=79712 
>Unformatted:
