Thread: BUG #4128: The postmaster.opts.default file is begin ignored

BUG #4128: The postmaster.opts.default file is begin ignored

From
"Gary Jay Peters"
Date:
The following bug has been logged online:

Bug reference:      4128
Logged by:          Gary Jay Peters
Email address:      gary@webdms.com
PostgreSQL version: 8.3.1
Operating system:   Linux/Debian
Description:        The postmaster.opts.default file is begin ignored
Details:

1st, I already have a work-round, but I wanted to let someone know about the
problem.

2nd, we are installing from source code and compiling the application
ourselves.

The problem --

As I understand it, the only the "pg_ctl" command uses the
"postmaster.opts.default" file; it uses the arguments
within "postmaster.opts.default" when spawning the "postmaster" process.

In older versions (such as "7.4.2"), the file
"postgresql-X.X.X/contrib/start-scripts/linux" uses
"pg_ctl" (see variable "DAEMON") to start the "postmaster" process.  Because
of this, the arguments within the "postmaster.opts.default" file are use.

In newer version (I am using "8.2.5", but "8.3.1" appears to handle it the
same way), the file "postgresql-X.X.X/contrib/start-scripts/linux" does not
use "pg_ctl" (see variable "PGCTL") to start the "postmaster" process.
Because of this, the arguments within the "postmaster.opts.default" file are
ignored.

Quickly looking through the source code, I found that the only file to
reference "postmaster.opts.default" is
"/postgresql-X.X.X/src/bin/pg_ctl/pg_ctl.c".

My work-around is to mutate the
"postgresql-X.X.X/contrib/start-scripts/linux" file adding a line
"DAEMON_START_ARGS=`[ -f $PGDATA/postmaster.opts.default ] && cat
$PGDATA/postmaster.opts.default`" and then changing each occurrence of
"$DAEMON -D '$PGDATA'" to
"$DAEMON $DAEMON_START_ARGS -D '$PGDATA'".

Lastly, to quote from the "postgresql-X.X.X/contrib/start-scripts/linux"
file, "What to use to start up the postmaster (we do NOT use pg_ctl for
this, as it adds no value and can cause the postmaster to misrecognize a
stale lock file)".

Gary Jay Peters
Database Management Services / HomeCU
(877) 670-2984 x 12
gary@webdms.com

Re: BUG #4128: The postmaster.opts.default file is begin ignored

From
Tom Lane
Date:
"Gary Jay Peters" <gary@webdms.com> writes:
> As I understand it, the only the "pg_ctl" command uses the
> "postmaster.opts.default" file; it uses the arguments
> within "postmaster.opts.default" when spawning the "postmaster" process.

Actually, I'd vote for ripping out that "feature" altogether.
That file has nothing whatever to recommend it, compared to editing
postgresql.conf --- it's no easier certainly, and you'll never be
able to change any options it sets without a postmaster restart.
We've mostly deprecated setting options on the postmaster command
line already, so why do we need another obscure way to do that?

            regards, tom lane

Re: BUG #4128: The postmaster.opts.default file is begin ignored

From
Alvaro Herrera
Date:
Tom Lane wrote:
> "Gary Jay Peters" <gary@webdms.com> writes:
> > As I understand it, the only the "pg_ctl" command uses the
> > "postmaster.opts.default" file; it uses the arguments
> > within "postmaster.opts.default" when spawning the "postmaster" process.
>
> Actually, I'd vote for ripping out that "feature" altogether.

I was about to say the same thing.  I was surprised to find that it's
still documented.

--
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

Re: BUG #4128: The postmaster.opts.default file is begin ignored

From
Peter Eisentraut
Date:
Tom Lane wrote:
> We've mostly deprecated setting options on the postmaster command
> line already, so why do we need another obscure way to do that?

As long as we support the pg_ctl -o option, the file still necessary so that
you get the same options after a restart.

Re: BUG #4128: The postmaster.opts.default file is begin ignored

From
Tom Lane
Date:
Peter Eisentraut <peter_e@gmx.net> writes:
> Tom Lane wrote:
>> We've mostly deprecated setting options on the postmaster command
>> line already, so why do we need another obscure way to do that?

> As long as we support the pg_ctl -o option, the file still necessary so that
> you get the same options after a restart.

No, it's the "postmaster.opts.default" file that I'm complaining about,
not the postmaster.opts file.

            regards, tom lane