Re: CentOS initd Script

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Devrim GÜNDÜZ <devrim(at)gunduz(dot)org>
Cc: Kenaniah Cerny <kenaniah(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: CentOS initd Script
Date: 2012-09-12 14:36:02
Message-ID: 25085.1347460562@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Devrim =?ISO-8859-1?Q?G=DCND=DCZ?= <devrim(at)gunduz(dot)org> writes:
> On Tue, 2012-09-11 at 23:41 -0700, Kenaniah Cerny wrote:
>> In the service script that gets installed to /etc/rc.d/init.d/, there is a
>> hard-coded value for PGPORT. Would it be possible to have this variable and
>> the corresponding -p flag set when calling postgres removed?

>> My main use case for this request is concurrently running multiple
>> versions of postgresql on non-standard ports on the same box.

> Ok, this is still doable -- just change ports on both postgresql.conf
> and init script, and start postmasters. I can't see why having PGPORT
> in the init script prevents there.

> There are some reasons for having it there, btw, like inefficiency of
> parsing postgresql.conf via shell script to get the port., etc.

Yeah. Historically the argument for doing it like this was (1) the
script couldn't reliably get the port value out of the configure file,
and (2) if you want to run multiple postmasters, you need distinct
PGPORT and PGDATA values for each one, so it was more consistent and
convenient to specify both those things at the service-script level.

Argument (1) is obsolete since PG 9.1 or so (maybe --- systemd's lame
excuse for a scripting language would still have trouble here). But
I still find argument (2) to be pretty convincing. What's the value
of specifying the port in postgresql.conf? AFAICS that would prevent
you from using identical config files for different postmasters, with
no real benefit in return.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2012-09-12 14:47:03 Re: Is there a way to use "pack" in pl/perl without resorting to pl/perlu?
Previous Message Herouth Maoz 2012-09-12 12:51:43 Is there a way to use "pack" in pl/perl without resorting to pl/perlu?