Re: Thoughts on the location of configuration files

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Trond Eivind Glomsrød <teg(at)redhat(dot)com>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Thoughts on the location of configuration files
Date: 2001-12-30 02:38:44
Message-ID: 200112300238.fBU2cig09451@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

[ Charset ISO-8859-1 unsupported, converting... ]
> Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
>
> > Therefore, a wired-in configuration file location near /etc would be
> > helpful or at least indifferent for most users.
> >
> > I suggest that we wire-in the location of the configuration files into the
> > binaries as ${sysconfdir} as determined by configure. This would default
> > to /usr/local/pgsql/etc, so the "everything in one place" system is still
> > somewhat preserved for those that care. For the confused, we could for a
> > while install into the data directory files named "postgresql.conf",
> > "pg_hba.conf", etc. that only contain text like "This file is now to be
> > found at @sysconfdir@ by popular demand."
> >
> > Furthermore, I suggest that we wire-in the default location of the data
> > files as ${localstatedir} as determined by configure. This would default
> > to /usr/local/pgsql/var, which is not quite the same as the customary
> > /usr/local/pgsql/data but it doesn't matter because with both "initdb" and
> > "postmaster" defaulting to this directory and the configuration files
> > elsewhere you don't really need to know except on few occasions. Having
> > this default would also save me a lot of typing during development. ;-)
> >
> > Surely we can also add a -C option to override the sysconfdir just as -D
> > overrides localstatedir. Those that refuse to convert can also set -C
> > equal to -D and have the old setup. Or the user can only specify -C to
> > point to the former -D and use the proposed 'datadir' parameter to find
> > the data area.
>
> I like this, but I'd prefer to have "-C" point to a specific
> configuration file.

I understand the value of pointing to a specific configuration file, but
we then would need to define the location of pg_hba.conf and others in
that file, and it makes it hard to move that directory anywhere because
the file paths have to be updated in the file. Of course, we could
default to look in the same directory as the config file, but that seems
quite confusing. Seems easier to just point to a directory and find all
the stuff in there you want.

This does allow you to share postgresql.conf, pg_hba.conf, and
pg_ident.conf with multiple servers if you override the port on
postmaster startup for each server. What it doesn't allow you to do is
share only pg_hba.conf. For that, you have to set up multiple
directories and symlink the pg_hba.conf's together.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2001-12-30 02:42:00 Re: LWLock contention: I think I understand the problem
Previous Message Bruce Momjian 2001-12-30 02:30:23 Re: LWLock contention: I think I understand the problem