pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Robin Iddon <robin@edesix.com>
To: pgsql-admin@postgresql.org
Subject: Re: PITR Based replication ...
Date: Wed, 05 Apr 2006 22:26:43 +0100
Message-ID: <44343613.1050304@edesix.com> (raw)
In-Reply-To: <37d451f70604051126s2bd2b322m1ebf76051bdcf02d@mail.gmail.com>
References: <4433AB17.7060705@edesix.com>
	<37d451f70604051126s2bd2b322m1ebf76051bdcf02d@mail.gmail.com>


> Anyone have any suggestions on novel phrases to offer in my incantations for
> getting this script to do everything I need?  
You need to add "-l $LOGFILE" where log is wherever you want to write 
the stderr+stdout from the postmaster to.  Then it will return once 
starting the server.

> Also, is there any way, in the case of shutting down the
> production instance for the second pass, to have the shutdown command wait
> indefinitely?  "-m smart" will give up after waiting so long, and I'd like
> neither to interrupt any running jobs, nor end up not taking a backup in the
> event a running job outlasts pg_ctl's timeout.
>
>   
Not that I know of, but you can poll the server status using the same 
pg_ctl command constructs as you're using already but with "status" 
instead of "stop" or "start".  pg_ctl (and hence ssh) will return 0 if 
the server is running and 1 if the server is no running. 

So you could try something like

while ssh $REMOTE pg_ctl -D $CLUSTER status
do
    echo "Remote server still running - continuing to wait ..."
    sleep 10
done

Hope this helps,

Robin




view thread (10+ messages)  latest in thread

Message-ID: <44343613.1050304@edesix.com>
Permalink:  ../44343613.1050304@edesix.com/
Also on:    postgresql.org/message-id/44343613.1050304@edesix.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: robin@edesix.com
  Subject: Re: PITR Based replication ...
  In-Reply-To: <44343613.1050304@edesix.com>
  References: <4433AB17.7060705@edesix.com> <37d451f70604051126s2bd2b322m1ebf76051bdcf02d@mail.gmail.com> <44343613.1050304@edesix.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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