Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

config file formats

1 view
Skip to first unread message

David Holland

unread,
Jul 19, 2011, 12:33:37 PM7/19/11
to
Would anyone object to adopting a convention in which if the first
line of a config file begins with "#@" it identifies the format?
E.g. if we were to deploy a new syslog.conf format this year the first
line of new-format syslogd config would be

#@syslogd 2011

or something. Maybe the number should be the netbsd version, and/or
maybe it should have "netbsd" in it.

There are a number of legacy formats we should be attempting to move
away from; methods like this make backwards compat work, having a
convention for it is an obvious plus, and I don't know of any existing
such convention suitable for /etc.

--
David A. Holland
dhol...@netbsd.org

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-...@muc.de

Mouse

unread,
Jul 19, 2011, 12:39:04 PM7/19/11
to
> Would anyone object to adopting a convention in which if the first
> line of a config file begins with "#@" it identifies the format?

I'm not sure whether I think this is a good idea or not - I find myself
liking and disliking it both at the same time.

But, stipualating for purposes of discussion that it is a good idea....

> Maybe the number should be the netbsd version, and/or maybe it should
> have "netbsd" in it.

Since some of the potentially-affected programs are shared with other
systems, I'd say using the NetBSD version would be a bad idea, at least
for those programs.

/~\ The ASCII Mouse
\ / Ribbon Campaign
X Against HTML mo...@rodents-montreal.org
/ \ Email! 7D C8 61 52 5D E7 2D 39 4E F1 31 3E E8 B3 27 4B

David Holland

unread,
Jul 19, 2011, 12:54:45 PM7/19/11
to
On Tue, Jul 19, 2011 at 12:39:04PM -0400, Mouse wrote:
> > Would anyone object to adopting a convention in which if the first
> > line of a config file begins with "#@" it identifies the format?
>
> I'm not sure whether I think this is a good idea or not - I find myself
> liking and disliking it both at the same time.

Someone just emailed me privately to point out that #@ looks too much
like @(#), which is a good point... perhaps #& or #%, although I don't
like the way #& looks and #% is giving me vague bad vibes, like maybe
it means something to Windows.

> But, stipualating for purposes of discussion that it is a good idea....
>

> > Maybe the number should be the netbsd version, and/or maybe it should
> > have "netbsd" in it.
>

> Since some of the potentially-affected programs are shared with other
> systems, I'd say using the NetBSD version would be a bad idea, at least
> for those programs.

I guess it depends on the program; for something like syslogd that's
everywhere, to introduce a new format and call it "version 2" or
something without a "netbsd" in it would either likely lead to
eventual confusion or require a prohibitive amount of politicking up
front.

Probably the convention should just state that there's a format name
and version and leave the details unspecified.

Matt Thomas

unread,
Jul 19, 2011, 2:01:13 PM7/19/11
to

On Jul 19, 2011, at 9:54 AM, David Holland wrote:

> On Tue, Jul 19, 2011 at 12:39:04PM -0400, Mouse wrote:

>>> Would anyone object to adopting a convention in which if the first
>>> line of a config file begins with "#@" it identifies the format?
>>

>> I'm not sure whether I think this is a good idea or not - I find myself
>> liking and disliking it both at the same time.
>

> Someone just emailed me privately to point out that #@ looks too much
> like @(#), which is a good point... perhaps #& or #%, although I don't
> like the way #& looks and #% is giving me vague bad vibes, like maybe
> it means something to Windows.

How about #== or #:=

Steven Bellovin

unread,
Jul 19, 2011, 2:46:11 PM7/19/11
to

On Jul 19, 2011, at 2:01 13PM, Matt Thomas wrote:

>
> On Jul 19, 2011, at 9:54 AM, David Holland wrote:
>
>> On Tue, Jul 19, 2011 at 12:39:04PM -0400, Mouse wrote:

>>>> Would anyone object to adopting a convention in which if the first
>>>> line of a config file begins with "#@" it identifies the format?
>>>

>>> I'm not sure whether I think this is a good idea or not - I find myself
>>> liking and disliking it both at the same time.
>>

>> Someone just emailed me privately to point out that #@ looks too much
>> like @(#), which is a good point... perhaps #& or #%, although I don't
>> like the way #& looks and #% is giving me vague bad vibes, like maybe
>> it means something to Windows.
>
> How about #== or #:=
>
>

Or #-) ...?
>


--Steve Bellovin, https://www.cs.columbia.edu/~smb

Adam Hamsik

unread,
Jul 19, 2011, 6:05:33 PM7/19/11
to

On Jul,Tuesday 19 2011, at 8:46 PM, Steven Bellovin wrote:

>
> On Jul 19, 2011, at 2:01 13PM, Matt Thomas wrote:
>
>>

>> On Jul 19, 2011, at 9:54 AM, David Holland wrote:
>>
>>> On Tue, Jul 19, 2011 at 12:39:04PM -0400, Mouse wrote:

>>>>> Would anyone object to adopting a convention in which if the first
>>>>> line of a config file begins with "#@" it identifies the format?
>>>>

>>>> I'm not sure whether I think this is a good idea or not - I find myself
>>>> liking and disliking it both at the same time.
>>>

>>> Someone just emailed me privately to point out that #@ looks too much
>>> like @(#), which is a good point... perhaps #& or #%, although I don't
>>> like the way #& looks and #% is giving me vague bad vibes, like maybe
>>> it means something to Windows.
>>
>> How about #== or #:=
>>
>>

> Or #-) ...?

What about simple ### this is not used anywhere as a signature.

Regards

Adam.

Marc Balmer

unread,
Jul 20, 2011, 6:03:22 AM7/20/11
to
Am 19.07.11 18:33, schrieb David Holland:

> Would anyone object to adopting a convention in which if the first
> line of a config file begins with "#@" it identifies the format?
> E.g. if we were to deploy a new syslog.conf format this year the first
> line of new-format syslogd config would be
>
> #@syslogd 2011
>
> or something. Maybe the number should be the netbsd version, and/or
> maybe it should have "netbsd" in it.

I just have a technical comment:

I guess this assumes that lines starting with '#' are considered
comments, but that is not true in all cases.

E.g. I have some config files that are actually Lua programs, and there
a comment is '--' (like in SQL) and other formats, like BIND zone files
use a semicolon.

Maybe the format specifier should appear somewehre on the first line,
then a construct like

-- #@syslogd 2012

would work as well.

>
> There are a number of legacy formats we should be attempting to move
> away from; methods like this make backwards compat work, having a
> convention for it is an obvious plus, and I don't know of any existing
> such convention suitable for /etc.


--

David Holland

unread,
Jul 21, 2011, 12:49:00 AM7/21/11
to
On Wed, Jul 20, 2011 at 12:03:22PM +0200, Marc Balmer wrote:
> I just have a technical comment:
>
> I guess this assumes that lines starting with '#' are considered
> comments, but that is not true in all cases.

Not entirely; it is convenient for the header to be a comment but not
particularly necessary. Making it a comment just saves the config
parser the trouble of skipping over it explicity.

> E.g. I have some config files that are actually Lua programs, and there
> a comment is '--' (like in SQL) and other formats, like BIND zone files
> use a semicolon.
>
> Maybe the format specifier should appear somewehre on the first line,
> then a construct like
>
> -- #@syslogd 2012
>
> would work as well.

I don't think that's a great idea (although if it is, the -*- foo -*-
syntax from emacs is another candidate) because ideally the code that
reads the header should be simple.

That is, like with exec, what you really want in general is

read(fd, buf);
if (!memcmp(buf, MAGIC_0)) format_0(fd);
else if (!memcmp(buf, MAGIC_1)) format_1(fd);
else if (!memcmp(buf, MAGIC_2)) format_2(fd);
...

with as little fuss as possible. Granted we probably don't want to be
doing major revisions of config file formats in /etc very often so
there shouldn't be many cases.

Anyway, I'm not sure I particularly like any of the proposed spellings
so far (including my own suggestion) but I'm glad to see nobody is
drastically against the idea. We can defer the choice of spelling
until I or someone has a real patch set ready; and maybe by then after
keeping the issue in the backs of our minds for a while it'll become
clearer.

Jasper Wallace

unread,
Aug 4, 2011, 5:43:29 AM8/4/11
to
On Tue, 19 Jul 2011, David Holland wrote:

> Would anyone object to adopting a convention in which if the first
> line of a config file begins with "#@" it identifies the format?
> E.g. if we were to deploy a new syslog.conf format this year the first
> line of new-format syslogd config would be
>
> #@syslogd 2011
>
> or something. Maybe the number should be the netbsd version, and/or
> maybe it should have "netbsd" in it.
>
> There are a number of legacy formats we should be attempting to move
> away from; methods like this make backwards compat work, having a
> convention for it is an obvious plus, and I don't know of any existing
> such convention suitable for /etc.

Do we have good enough support for extended attributes that they would
work instead?

(Thinking about it a bit more it might be too much like hard work, when
you change a files format you have to remember to change the attribute
with it, i can see people forgetting and that causing all kinds of
issues).

--
[http://pointless.net/] [0x2ECA0975]

Message has been deleted
0 new messages