From owner-freebsd-bugs@FreeBSD.ORG Mon Jun 11 05:20:19 2007 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5A49D16A46F for ; Mon, 11 Jun 2007 05:20:19 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id 3984C13C484 for ; Mon, 11 Jun 2007 05:20:19 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l5B5KJFm086959 for ; Mon, 11 Jun 2007 05:20:19 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l5B5KJuJ086958; Mon, 11 Jun 2007 05:20:19 GMT (envelope-from gnats) Resent-Date: Mon, 11 Jun 2007 05:20:19 GMT Resent-Message-Id: <200706110520.l5B5KJuJ086958@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, Mike Brown Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D294F16A468 for ; 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 ; 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 ; 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 To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: conf/113552: ntpd driftfile default location inconsistently referenced X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Mike Brown List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2007 05:20:19 -0000 >Number: 113552 >Category: conf >Synopsis: ntpd 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: >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: