Proposed enhancement to the init.d script

From: "Gudmundsson Martin (mg)" <martin(dot)mg(dot)gudmundsson(at)volvo(dot)com>
To: "pgsql-pkg-yum(at)postgresql(dot)org" <pgsql-pkg-yum(at)postgresql(dot)org>
Subject: Proposed enhancement to the init.d script
Date: 2013-10-10 06:51:54
Message-ID: 2E5766F28426E547AF0A2A870FAE630D17669C@SEGOTNC5182-N2.vcn.ds.volvo.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-pkg-yum

Hi!
I'm using the intit.d scripts to start our Postgres clusters. Also I am creating new files in /etc/sysconfig/pgsql and new links in /etc/init.d if I want new clusters.

I would like support in the init.d script, in the initdb function to also specify pg_xlog path, if specified in /etc/sysconfig/pgsql file.

So, let's say I have the following in /etc/sysconfig/pgsql/secondary-9.3:

PGENGINE=/usr/pgsql-9.3/bin
PGPORT=5432
PGDATA=/var/lib/pgsql/9.3/data
PGLOG=/var/lib/pgsql/9.3/pgstartup.log
PGXLOG=/var/lib/pgsql/9.3/xlog # Added by me :)

And then have the initdb function check for PGXLOG environment variable and if set, call initdb with -X $PGXLOG.

If this would be put in place it would be easier to automatically provision new postgres clusters according to our standards by using standard RHEL system commands from puppet, cfengine etc.
Then we just create a new file in /etc/sysconfig/pgsql with the settings for the new cluster, create a link in /etc/init.d from secondary-9.3 to postgres-9.3.
Then we just do:
# service secondary-9.3 initdb
# service secondary-9.3 start
# chkconfig secondary-9.3 on

And we would have a fully functional postgres cluster with xlog and data separated.

Would this be something that would be possible to implement? I could probably write a patch if wanted.

Best regards,

Martin Gudmundsson
Database Technical Specialist
Infrastructure Architect

Volvo Information Technology
IMO Java Database Gothenburg
Dept DE56720, DA2N
SE-405 08 Gothenburg, Sweden
Tel: +46 31 3224333
Email: martin(dot)mg(dot)gudmundsson(at)volvo(dot)com
P Please consider your environmental responsibility. Before printing this e-mail ask yourself:- "Do I need a hard copy?"

Responses

Browse pgsql-pkg-yum by date

  From Date Subject
Next Message Devrim GÜNDÜZ 2013-10-10 11:14:11 Re: Proposed enhancement to the init.d script
Previous Message Devrim GÜNDÜZ 2013-10-09 14:55:30 Re: "yum update" breaking postgis 2.0 installations?