Re: CentOS initd Script - Mailing list pgsql-general

From Ondrej Ivanič
Subject Re: CentOS initd Script
Date
Msg-id CAM6mieKHSWHDhUAkA6x9-CsCX_UCx5bUy5zHgASHSsPnmu01fA@mail.gmail.com
Whole thread Raw
In response to CentOS initd Script  (Kenaniah Cerny <kenaniah@gmail.com>)
List pgsql-general
Hi,

On 12 September 2012 16:41, Kenaniah Cerny <kenaniah@gmail.com> 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 init.d script has the following:
# 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}

In this case you can create as many configs as you need, for example:
/etc/sysconfig/pgsql/postgresql:
PGDATA=/var/lib/pgsql/data
PGPORT=5432
PGLOG=/var/lib/pgsql/pgstartup.log
PGOPTS='--config_file=/etc/postgresql.conf'

/etc/sysconfig/pgsql/postgresql2:
PGDATA=/var/lib/pgsql2/data
PGPORT=54320
PGLOG=/var/lib/pgsql2/pgstartup.log
PGOPTS='--config_file=/etc/postgresql.conf'

and create /etc/init.d/postgresql2 as symlink to /etc/init.d/postgresql

--
Ondrej Ivanic
(ondrej.ivanic@gmail.com)


pgsql-general by date:

Previous
From: François Beausoleil
Date:
Subject: Re: Amazon High I/O instances
Next
From: John R Pierce
Date:
Subject: Re: Amazon High I/O instances