pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feedBUG #6074: postgresql service script
4+ messages / 4 participants
[nested] [flat]
* BUG #6074: postgresql service script
@ 2011-06-22 12:47 Tomas Enrique Cardozo Baudry <tomas.enrique.cardozo.baudry@gmail.com>
2011-06-23 03:35 ` Re: BUG #6074: postgresql service script Craig Ringer <craig@postnewspapers.com.au>
0 siblings, 1 reply; 4+ messages in thread
From: Tomas Enrique Cardozo Baudry @ 2011-06-22 12:47 UTC (permalink / raw)
To: pgsql-bugs
The following bug has been logged online:
Bug reference: 6074
Logged by: Tomas Enrique Cardozo Baudry
Email address: tomas.enrique.cardozo.baudry@gmail.com
PostgreSQL version: 8.4.4
Operating system: Centos 5.6
Description: postgresql service script
Details:
configuring the posgresql.conf on another port the service doesnt load the
port variable, because in the postgresql service script is a variable PGPORT
and this rewrite the configuration variable
solution (replace the port number with a script variable reader):
PGDATA=/var/lib/pgsql/data
#PGPORT=5432 #### <--- this is the bug
PGPORT=`/bin/cat $PGDATA/postgresql.conf | /bin/grep ’^port' | /bin/sed
's/port = //g'`
tomas.enrique.cardozo.baudry@gmail.com, deshn.co.cc@gmail.com
http://deshn.wikidot.com/howtos:bases-de-datos:postgresql:pgsql-service-scri
pt
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: BUG #6074: postgresql service script
2011-06-22 12:47 BUG #6074: postgresql service script Tomas Enrique Cardozo Baudry <tomas.enrique.cardozo.baudry@gmail.com>
@ 2011-06-23 03:35 ` Craig Ringer <craig@postnewspapers.com.au>
2011-06-23 03:52 ` Re: BUG #6074: postgresql service script Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 4+ messages in thread
From: Craig Ringer @ 2011-06-23 03:35 UTC (permalink / raw)
To: Tomas Enrique Cardozo Baudry <tomas.enrique.cardozo.baudry@gmail.com>; +Cc: pgsql-bugs
On 22/06/11 20:47, Tomas Enrique Cardozo Baudry wrote:
>
> The following bug has been logged online:
>
> Bug reference: 6074
> Logged by: Tomas Enrique Cardozo Baudry
> Email address: tomas.enrique.cardozo.baudry@gmail.com
> PostgreSQL version: 8.4.4
> Operating system: Centos 5.6
> Description: postgresql service script
> Details:
>
> configuring the posgresql.conf on another port the service doesnt load the
> port variable, because in the postgresql service script is a variable PGPORT
> and this rewrite the configuration variable
I'm pretty sure that init script is part of CentOS (probably really part
of Red Hat Enterprise Linux), not part of PostgreSQL.
The script should *not* respect values from the environment; it's a good
thing that it doesn't. Otherwise setting PGPORT to tell psql what to do
would as a side effect change what port the server listened on if you
restarted it from that shell!
What the script should do is get those settings from /etc/sysconfig or
/etc/default (dunno which CentOS uses) so you don't have to hack the
init script directly.
--
Craig Ringer
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: BUG #6074: postgresql service script
2011-06-22 12:47 BUG #6074: postgresql service script Tomas Enrique Cardozo Baudry <tomas.enrique.cardozo.baudry@gmail.com>
2011-06-23 03:35 ` Re: BUG #6074: postgresql service script Craig Ringer <craig@postnewspapers.com.au>
@ 2011-06-23 03:52 ` Tom Lane <tgl@sss.pgh.pa.us>
2011-06-23 07:35 ` Re: BUG #6074: postgresql service script Dave Page <dpage@pgadmin.org>
0 siblings, 1 reply; 4+ messages in thread
From: Tom Lane @ 2011-06-23 03:52 UTC (permalink / raw)
To: Craig Ringer <craig@postnewspapers.com.au>; +Cc: Tomas Enrique Cardozo Baudry <tomas.enrique.cardozo.baudry@gmail.com>; pgsql-bugs
Craig Ringer <craig@postnewspapers.com.au> writes:
> On 22/06/11 20:47, Tomas Enrique Cardozo Baudry wrote:
>> configuring the posgresql.conf on another port the service doesnt load the
>> port variable, because in the postgresql service script is a variable PGPORT
>> and this rewrite the configuration variable
> I'm pretty sure that init script is part of CentOS (probably really part
> of Red Hat Enterprise Linux), not part of PostgreSQL.
The relevant part of the RHEL5 initscript is
# Set defaults for configuration variables
PGENGINE=/usr/bin
PGPORT=5432
PGDATA=/var/lib/pgsql/data
PGLOG=/var/lib/pgsql/pgstartup.log
# Override defaults from /etc/sysconfig/pgsql if file is present
[ -f /etc/sysconfig/pgsql/${NAME} ] && . /etc/sysconfig/pgsql/${NAME}
As this indicates, you are supposed to change those settings with a
script in /etc/sysconfig/pgsql/ if you need to change 'em. It's
intentional that those settings win out over postgresql.conf.
I'm not entirely sure that the OP is using the RHEL RPMs, though,
because the fragment he quoted didn't quite match this.
regards, tom lane
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: BUG #6074: postgresql service script
2011-06-22 12:47 BUG #6074: postgresql service script Tomas Enrique Cardozo Baudry <tomas.enrique.cardozo.baudry@gmail.com>
2011-06-23 03:35 ` Re: BUG #6074: postgresql service script Craig Ringer <craig@postnewspapers.com.au>
2011-06-23 03:52 ` Re: BUG #6074: postgresql service script Tom Lane <tgl@sss.pgh.pa.us>
@ 2011-06-23 07:35 ` Dave Page <dpage@pgadmin.org>
0 siblings, 0 replies; 4+ messages in thread
From: Dave Page @ 2011-06-23 07:35 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Craig Ringer <craig@postnewspapers.com.au>; Tomas Enrique Cardozo Baudry <tomas.enrique.cardozo.baudry@gmail.com>; pgsql-bugs
On Thu, Jun 23, 2011 at 4:52 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> I'm not entirely sure that the OP is using the RHEL RPMs, though,
> because the fragment he quoted didn't quite match this.
>
It doesn't look like the script from the installers either.
--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2011-06-23 07:35 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-06-22 12:47 BUG #6074: postgresql service script Tomas Enrique Cardozo Baudry <tomas.enrique.cardozo.baudry@gmail.com>
2011-06-23 03:35 ` Craig Ringer <craig@postnewspapers.com.au>
2011-06-23 03:52 ` Tom Lane <tgl@sss.pgh.pa.us>
2011-06-23 07:35 ` Dave Page <dpage@pgadmin.org>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox