Skip site navigation (1) Skip section navigation (2)

Weird pg_ctl behaviour via ssh

From: Bohdan Linda <bohdan(dot)linda(at)seznam(dot)cz>
To: pgsql-general(at)postgresql(dot)org
Subject: Weird pg_ctl behaviour via ssh
Date: 2008-07-31 09:24:35
Message-ID: 20080731092435.GA8246@bafster.baflabs.org (view raw or flat)
Thread:
Lists: pgsql-general
Hello,

I am fiddling around with pgpool-II and online recovery. Recovery depends
on remote starting of a cluster. This means I need to ssh into a box,
start clustern (with PITR recovery) and terminate that ssh connection.

If I use the following script:

ssh -T remote "export LD_LIBRARY_PATH=/opt/postgres-8.3.3/lib;
nohup /opt/postgres-8.3.3/bin/pg_ctl -w -D /data/pg833-data start >
/dev/null 2>&1;exit;"

the script terminates earlier than the DB is up:

/opt/postgres-8.3.3/bin/psql -h remote -p 5555 postgres
psql: FATAL:  the database system is starting up

which is problem for pgpool. But if I use command:

ssh -T remote "export LD_LIBRARY_PATH=/opt/postgres-8.3.3/lib;
nohup /opt/postgres-8.3.3/bin/pg_ctl -w -D /data/pg833-data start
2>&1;exit;"

the ssh never terminates. Which is, again problem for pg_pool. The outoput
will be as bellow. How can I terminate the script really at the moment
when DB is up?

Thank you,
Bohdan 

...
.FATAL:  the database system is starting up
.scp: /data/archive_log/00000004.history: No such file or directory
could not start server
scp: /data/archive_log/00000005.history: No such file or directory
scp: /data/archive_log/00000006.history: No such file or directory
scp: /data/archive_log/00000007.history: No such file or directory
scp: /data/archive_log/00000008.history: No such file or directory
scp: /data/archive_log/00000009.history: No such file or directory
scp: /data/archive_log/0000000A.history: No such file or directory
scp: /data/archive_log/0000000B.history: No such file or directory
scp: /data/archive_log/0000000C.history: No such file or directory
scp: /data/archive_log/0000000D.history: No such file or directory
scp: /data/archive_log/0000000E.history: No such file or directory
scp: /data/archive_log/0000000F.history: No such file or directory
scp: /data/archive_log/00000010.history: No such file or directory
scp: /data/archive_log/00000011.history: No such file or directory
LOG:  selected new timeline ID: 17
scp: /data/archive_log/00000001.history: No such file or directory
LOG:  archive recovery complete
LOG:  autovacuum launcher started
LOG:  database system is ready to accept connections


Responses

pgsql-general by date

Next:From: Cousin FlorenceDate: 2008-07-31 09:51:36
Subject:
Previous:From: Craig RingerDate: 2008-07-31 09:08:18
Subject: Re: Statistics Data archiving with Postgres

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group