Request for design critique - configuration directories

Eric S. Raymond esr at thyrsus.com
Thu Mar 23 18:16:17 UTC 2017


We have an open issue #204 on the tracker: Support /etc/ntp.d

We also have a forward-compatibility problem coming down the road when
the reference-clock support gets split out of ntpd. The problem is
that, ideally, we want the config parser to split in half as well,
with refclockd config syntax nolonger being interpreted by ntpd and
ntpd config syntax no longer being interpreted by refclockd. And we
want to do this without causing a flag day.

I may have come up with a design that solves both problems.  Critique
invited. Here's how it would work.

1. First, ntp.conf in the default location - or wherever it's set by
the -c option - is parsed.

2. Then the code looks for a directory named ntp.d in the same
directory as the plain config. Normally this will be /etc, but -c
could change that.

3. If that directory exists, its subfiles are interpreted in ASCII
order of the names (so you can do the old-school init.d trick
of fording an evaluation order with numeric name prefixes).

4. Here's the tricky part.  Not every file is interpreted by every
program.  Initially, only files with the extensions ".ntpd" and
".refclockd" are interpreted by ntpd. Other files are skipped.

5. The "other files are skipped" is a convenience for configurators,
which can use file renames to enable and disable configuration
snippets while leaving the file conyent of snippets untouched.

6. We advise admins that it is best practice to write their configs with
split .ntpd and .refclockd files as through the parsers were already
separate.

7. When the split actually happens:

* Anyone running without refclocks wasn't exposed to begin with.
  (This is doubtless more than 99% of all installations.)

* Anyone who followed documented best practices is unaffected.

* Anyone who didn't sees loud, obvious breakage (syntax errors) in
  their log files and has a pretty clear path to fixing the problem.
-- 
		<a href="http://www.catb.org/~esr/">Eric S. Raymond</a>

All governments are more or less combinations against the
people. . .and as rulers have no more virtue than the ruled. . .
the power of government can only be kept within its constituted
bounds by the display of a power equal to itself, the collected
sentiment of the people.
	-- Benjamin Franklin Bache, in a Phildelphia Aurora editorial 1794


More information about the devel mailing list