Discussion:
How to start several PostgreSQL clusters at boot time on a Debian OS
Léa Massiot
2014-10-15 10:18:58 UTC
Permalink
Hello and thank you for reading my post.

My question is about starting PostgreSQL clusters at boot time.

The OS is Debian Wheezy.
I have installed PostgreSQL from the sources (postgresql-9.3.5.tar.gz) at
http://www.postgresql.org/ftp/source/v9.3.5/.

In a shell and logged as "unprivileged_user" (a user which is not "root"), I
presently have two clusters that I can start manually like this:
unprivileged_user> pg_ctl start -D /where/cluster1/is/located/pgcluster1 -l
/where/cluster1/is/located/pgcluster1.log
unprivileged_user> pg_ctl start -D /where/cluster2/is/located/pgcluster2 -l
/where/cluster2/is/located/pgcluster2.log

I would like to start the clusters at boot time and I would like them to be
started as the non-root user "unprivileged_user".
I would need a "/etc/init.d/" script...

Can you advise me how to do that?
Best regards.



--
View this message in context: http://postgresql.1045698.n5.nabble.com/How-to-start-several-PostgreSQL-clusters-at-boot-time-on-a-Debian-OS-tp5823085.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.
--
Sent via pgsql-general mailing list (pgsql-***@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
Guillaume Lelarge
2014-10-15 10:44:09 UTC
Permalink
Hi,
Post by Léa Massiot
Hello and thank you for reading my post.
My question is about starting PostgreSQL clusters at boot time.
The OS is Debian Wheezy.
I have installed PostgreSQL from the sources (postgresql-9.3.5.tar.gz) at
http://www.postgresql.org/ftp/source/v9.3.5/.
In a shell and logged as "unprivileged_user" (a user which is not "root"), I
unprivileged_user> pg_ctl start -D /where/cluster1/is/located/pgcluster1 -l
/where/cluster1/is/located/pgcluster1.log
unprivileged_user> pg_ctl start -D /where/cluster2/is/located/pgcluster2 -l
/where/cluster2/is/located/pgcluster2.log
I would like to start the clusters at boot time and I would like them to be
started as the non-root user "unprivileged_user".
I would need a "/etc/init.d/" script...
Can you advise me how to do that?
There is one in PostgreSQL source files. Look into contrib/start-scripts
directory. There is a linux script. Copy it under another name in the
/etc/init.d/ directory. Duplicate it. And change it wrt to your
installations.

Regards.
--
Guillaume.
http://blog.guillaume.lelarge.info
http://www.dalibo.com
Léa Massiot
2014-10-15 11:01:24 UTC
Permalink
It's perfect.
Thank you very much.



--
View this message in context: http://postgresql.1045698.n5.nabble.com/How-to-start-several-PostgreSQL-clusters-at-boot-time-on-a-Debian-OS-tp5823085p5823088.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.
--
Sent via pgsql-general mailing list (pgsql-***@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
Adrian Klaver
2014-10-15 13:53:45 UTC
Permalink
Post by Léa Massiot
Hello and thank you for reading my post.
My question is about starting PostgreSQL clusters at boot time.
The OS is Debian Wheezy.
I have installed PostgreSQL from the sources (postgresql-9.3.5.tar.gz) at
http://www.postgresql.org/ftp/source/v9.3.5/.
In a shell and logged as "unprivileged_user" (a user which is not "root"), I
unprivileged_user> pg_ctl start -D /where/cluster1/is/located/pgcluster1 -l
/where/cluster1/is/located/pgcluster1.log
unprivileged_user> pg_ctl start -D /where/cluster2/is/located/pgcluster2 -l
/where/cluster2/is/located/pgcluster2.log
I would like to start the clusters at boot time and I would like them to be
started as the non-root user "unprivileged_user".
I would need a "/etc/init.d/" script...
Are you aware that 9.3 is available for Wheezy from the Postgres Apt Repo?:

http://www.postgresql.org/download/linux/debian/

If you use the package you can get what you want built in, using
pg_createcluster among other tools.
Post by Léa Massiot
Can you advise me how to do that?
Best regards.
--
View this message in context: http://postgresql.1045698.n5.nabble.com/How-to-start-several-PostgreSQL-clusters-at-boot-time-on-a-Debian-OS-tp5823085.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.
--
Adrian Klaver
***@aklaver.com
--
Sent via pgsql-general mailing list (pgsql-***@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
Léa Massiot
2014-10-16 15:13:27 UTC
Permalink
Hello Adrian,
Yes, I am aware of it. I even used to use Debian pg_createcluster and other
tools before.
Even so, thank you for your comment.
Best regards.



--
View this message in context: http://postgresql.1045698.n5.nabble.com/How-to-start-several-PostgreSQL-clusters-at-boot-time-on-a-Debian-OS-tp5823085p5823264.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.
--
Sent via pgsql-general mailing list (pgsql-***@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
Loading...