Re: location of the configuration files - Mailing list pgsql-hackers

From Lamar Owen
Subject Re: location of the configuration files
Date
Msg-id 200302132039.13966.lamar.owen@wgcr.org
Whole thread Raw
In response to Re: location of the configuration files  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: location of the configuration files
List pgsql-hackers
On Thursday 13 February 2003 20:09, Bruce Momjian wrote:
> Lamar Owen wrote:
> > This isn't the same environment, Bruce, that you got into back when it
> > was still Postgres95.

> So you are saying this isn't my grandma's database anymore.  :-)

I actually thought of saying it that way, too. :-)

> Anyway, I think I have _a_ proposal that we can use to work toward a
> goal.

> First, a few conclusions:

>     We can't use /var/run because we need the postmaster to create
>     those, and it isn't root.

It isn't without precedent to have a directory under /var/run.  Maybe
/var/run/postgresql.  Under this one could have a uniquely named pid file.  I
say uniquely named so that multiple postmasters could run.  Naming those
files could be fun. /var/run/postgresql would be owned by the postmaster run
user.  This of course requires root to install -- but would be completely
optional.

>         pg_dumpall > foo && rm -rf $PGDATA && initdb

>     discards all the config files.

Yes, this is a big deal.  It makes it more difficult to properly restore.
While it's not impossible to do so now, of course, it just could be a little
easier.

> So, I propose we change a few things.

> OK, first, we keep postmaster.pid and postmaster.opts in /data.  We
> can't put them in /var/run, and /data seems like the best spot for them.

Can we make that configurable?  The default in pgdata is fine; just having the
option is good.

> That leaves postgresql.conf, pg_hba.conf, and pg_ident.conf.  I
> recommend moving them all, by default, into pgsql/etc.  I recommend we
> add these to postgresql.conf:

>     data_dir = ../data
>     pg_hba_dir = ./
>     pg_ident_dir = ./

> Those paths are relative to postgresql.conf.

And these are all just defaults, easily changed.  Good.

> We then add a PGCONFIG variable and postmaster -C flag to point to the
> config _directory_.  That way, if folks want to move all of this into
> /etc, then easily do that.  This also pulls those files out of /data so
> they are easier to back up.

Yes.  I'm thinking along the lines of this sort of structure:
/etc
|---postgresql               |----- name of postmaster one (unique ID of some kind)               |----- name of
postmastertwo                   .                   . 

Not difficult.

> We can also firm up stuff in 7.5 by removing PGDATA and -D, and perhaps
> removing the other duplicate postmaster flags that have postgresql.conf
> entries.

Now I really _like_ this idea.  By removing it to 7.5, and therefore
deprecating it in 7.4, this brings best practice into effect.

However, at the same time, I wouldn't be opposed to leaving them in place,
either, for backwards compatibility.
--
Lamar Owen
WGCR Internet Radio
1 Peter 4:11



pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Do we always need the socket file?
Next
From: Bruce Momjian
Date:
Subject: Re: Someone's broken psql's connection-failure error reporting