Re: Parsing config files in a directory

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Greg Stark <gsstark(at)mit(dot)edu>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Greg Smith <gsmith(at)gregsmith(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Josh Berkus <josh(at)agliodbs(dot)com>, Dimitri Fontaine <dfontaine(at)hi-media(dot)com>, Magnus Hagander <magnus(at)hagander(dot)net>, Simon Riggs <simon(at)2ndquadrant(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Parsing config files in a directory
Date: 2009-10-29 11:49:53
Message-ID: 1256816993.22925.25.camel@fsopti579.F-Secure.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, 2009-10-28 at 09:39 -0700, Greg Stark wrote:
> On Wed, Oct 28, 2009 at 7:33 AM, Alvaro Herrera
> <alvherre(at)commandprompt(dot)com> wrote:
> > Greg Smith escribió:
> >
> >> This sounds familiar...oh, that's right, this is almost the same
> >> algorithm pgtune uses. And it sucks,
>
> It's also a blatant violation of packaging rules for Debian if not
> every distribution. If you edit the user's configuration file then
> there's no way to install a modified default configuration file. You
> can't tell the automatic modifications apart from the user's
> modifications. So the user will get a prompt asking if he wants the
> new config file or to keep his modifications which he never remembered
> making.

This is not quite accurate. What the Debian policy says is that local
changes to configuration files must be preserved during package
upgrades. You are free to implement this in a variety of ways. One way
to do it is to mark the file a "conffile" with dpkg, and then dpkg will
handle the upgrades. If you mark a configuration file a "conffile",
then packages' maintainer scripts are not allowed to touch the file
(because dpkg handles it).

But this is irrelevant for the postgresql package, because
postgresql.conf is not a conffile, primarily because it is created by
the postgresql package's maintainer script in the first place (via
initdb).

Moreover, it is not illegal for a program or a routine that is
explicitly invoked by a user to modify a configuration file (or a
"conffile" even). The only policy is again packages' maintainer scripts
(preinst, postint, prerm, postrm, for those reading along) modifying
"conffiles" *automatically* during package installation or removal.

So from a Debian packaging policy point of view, none of the schemes
described so far appear to be disallowed outright.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Cédric Villemain 2009-10-29 11:55:08 Re: Parsing config files in a directory
Previous Message Peter Eisentraut 2009-10-29 11:25:21 Re: Parsing config files in a directory