conf/113552: ntpd driftfile default location inconsistently referenced

Mike Brown mike at hyperreal.org
Mon Jun 11 05:20:19 UTC 2007


>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 at 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:


More information about the freebsd-bugs mailing list