From mike@hyperreal.org  Mon Jun 11 05:19:29 2007
Return-Path: <mike@hyperreal.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id D294F16A468
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 11 Jun 2007 05:19:29 +0000 (UTC)
	(envelope-from mike@hyperreal.org)
Received: from taz4.hyperreal.org (taz4.hyperreal.org [209.237.226.92])
	by mx1.freebsd.org (Postfix) with ESMTP id A932113C447
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 11 Jun 2007 05:19:29 +0000 (UTC)
	(envelope-from mike@hyperreal.org)
Received: from taz4.hyperreal.org (localhost [127.0.0.1])
	by taz4.hyperreal.org (8.13.6/8.13.6) with ESMTP id l5B4mfeO054058
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 10 Jun 2007 21:48:41 -0700 (PDT)
	(envelope-from mike@taz4.hyperreal.org)
Received: (from root@localhost)
	by taz4.hyperreal.org (8.13.6/8.13.6/Submit) id l5B4mZ03054057;
	Sun, 10 Jun 2007 21:48:35 -0700 (PDT)
	(envelope-from mike)
Message-Id: <200706110448.l5B4mZ03054057@taz4.hyperreal.org>
Date: Sun, 10 Jun 2007 21:48:35 -0700 (PDT)
From: Mike Brown <mike@hyperreal.org>
Reply-To: Mike Brown <mike@hyperreal.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: ntpd driftfile default location inconsistently referenced
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         113552
>Category:       conf
>Synopsis:       [request] ntpd(8) driftfile default location inconsistently referenced
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jun 11 05:20:18 GMT 2007
>Closed-Date:    
>Last-Modified:  Mon May 05 01:36:04 UTC 2008
>Originator:     Mike Brown
>Release:        FreeBSD 6.2-STABLE i386
>Organization:
>Environment:
System: FreeBSD taz4.hyperreal.org 6.2-STABLE FreeBSD 6.2-STABLE #6: Sat Jun 2 12:31:05 PDT 2007 brian@taz4.hyperreal.org:/usr/obj/usr/src/sys/SMP i386


>Description:
The ntpd(8) man page says:
     /etc/ntp.conf   the default name of the configuration file
     /etc/ntp.drift  the default name of the drift file
     /etc/ntp.keys   the default name of the key file
(The pidfile isn't mentioned.)

/etc/defaults/rc.conf sets ntpd_config to "/etc/ntp.conf"
which is consistent with the man page, but it sets
ntpd_flags as follows:
    -d /var/db/ntpd.drift    (especially note the "ntpd")
    -p /var/run/ntpd.pid

Meanwhile, /etc/rc.d/ntpd at one point assumes that the driftfile is
/var/db/ntp.drift (no "d").  This assumption is apparently only made in
chroot situations but is wrong, regardless.

On top of that, it's quite common to specify driftfile, if not also
pidfile, in one's ntp.conf. This apparently overrides whatever is given
on the command line, but I don't know if it's safe to assume that it
always will.

The fact that the default driftfile and pidfile locations are confusing
was raised a couple years ago: 

http://lists.freebsd.org/pipermail/freebsd-questions/2005-May/087170.html
>How-To-Repeat:
>Fix:

Ideally, stop using the default driftfile name "ntpd.drift"; change
ntpd_flags to refer to ntp.drift.

Alternatively, leave the default driftfile as "ntpd.drift"; change
/etc/rc.d/ntpd to refer to ${name}.drift (perhaps) instead of ntp.drift.

In either case, update the FILES section of the ntpd(8) man page to refer
to the actual default.

Note that /etc/rc.d/ntpd still won't really be very smart about its
symlinking of the driftfile, since it could be overridden by ntpd_flags
or within the $ntpd_config file, so consider making that more robust,
or at least display a warning if the file isn't where it was assumed to be.
>Release-Note:
>Audit-Trail:
>Unformatted:
