<div dir="ltr"><div><div>Thanks the sample! <br><br></div>I have tried "-t" and "-T" also for ssh, but none helped.<br>Also I have tried your recommendation without the trailing "&", and it did not work either, so the main difference is this, and not the ssh parameters, or the redirections.<br>


<br></div><div>So thanks a lot, it works now!<br></div><div>regards,<br><br>Attila<br></div><div><br></div><div>p.s.<br></div><div>My current script is:<br>---------------------------------<br>#!/bin/sh<br>/usr/bin/logger Called "$0" "$*"<br>


<br>DEST=$1<br>DESTDIR=$2<br>PGCTL="/usr/lib/postgresql/9.3/bin/pg_ctl"<br>COMMAND="ssh -T postgres@$DEST $PGCTL -w -D $DESTDIR start 2>/dev/null 1>/dev/null </dev/null &"<br><br>/usr/bin/logger -- Trying "$COMMAND"<br>


<br>eval $COMMAND<br><br>/usr/bin/logger -- Leaving "$0"<br>---------------------------------<br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-03-10 14:53 GMT+01:00 Tatsuo Ishii <span dir="ltr"><<a href="mailto:ishii@postgresql.org" target="_blank">ishii@postgresql.org</a>></span>:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">You specify "ssh -t" which forces to allocate tty. Also you do not<br>
detach stdin, stderr and stdout which cause the script to wait for<br>
something from stdin forever.<br>
<br>
Here is the pgpool_remote_start I'm using.<br>
-------------------------------------------------------------------------------<br>
#! /bin/sh<br>
#<br>
# start postmaster on the recovered node<br>
#<br>
if [ $# -ne 2 ]<br>
then<br>
    echo "pgpool_remote_start remote_host remote_datadir"<br>
    exit 1<br>
fi<br>
<br>
DEST=$1<br>
DESTDIR=$2<br>
PGCTL=/usr/local/pgsql/bin/pg_ctl<br>
<br>
ssh -T $DEST $PGCTL -w -D $DESTDIR start 2>/dev/null 1>/dev/null < /dev/null &<br>
-------------------------------------------------------------------------------<br>
<br>
Best regards,<br>
--<br>
Tatsuo Ishii<br>
SRA OSS, Inc. Japan<br>
English: <a href="http://www.sraoss.co.jp/index_en.php" target="_blank">http://www.sraoss.co.jp/index_en.php</a><br>
Japanese: <a href="http://www.sraoss.co.jp" target="_blank">http://www.sraoss.co.jp</a><br>
<div class="HOEnZb"><div class="h5"><br>
> Dear Guys,<br>
><br>
> I have got a problem...<br>
><br>
> I started to use pgpool2 3.3 with postgresql 9.3 on Debian 7.3, using the<br>
> pgpool/postgresql repositories.<br>
><br>
> I have setup a cluster of two pgpool2 nodes and three backend databases. It<br>
> works in a way after setup, but when I started to test the steps that<br>
> should be done for recovery/adding a node, I have ran into the following<br>
> problem:<br>
><br>
> When pgpool starts the pgpool_remote_start script, it never returns. After<br>
> the end of the scripts, pcp_recovery_node waits until the end of time.<br>
><br>
> Running the script by hand always work.<br>
><br>
> postgres@pool-1:~$ /usr/sbin/pcp_recovery_node -d 0 localhost 9898 postgres<br>
> DifficultPassword 2<br>
> DEBUG: send: tos="R", len=46<br>
> DEBUG: recv: tos="r", len=21, data=AuthenticationOK<br>
> DEBUG: send: tos="D", len=6<br>
><br>
> ... and just waits forever...<br>
><br>
> Meanwhile the remote postgresql DB is up and running:<br>
><br>
> postgres@pool-3:~$ /usr/lib/postgresql/9.3/bin/pg_ctl -w -D<br>
> /var/lib/postgresql/9.3/main/ status<br>
> pg_ctl: server is running (PID: 8780)<br>
><br>
><br>
> The pgpool_remote_start script is:<br>
> postgres@pool-1:~$ /var/lib/postgresql/pgpool_remote_start pool-3<br>
> /var/lib/postgresql/9.3/main/<br>
> waiting for server to start....2014-03-03 14:33:50 CET LOG:  database<br>
> system was shut down at 2014-03-03 14:33:42 CET<br>
> 2014-03-03 14:33:50 CET LOG:  database system is ready to accept connections<br>
> 2014-03-03 14:33:50 CET LOG:  autovacuum launcher started<br>
>  done<br>
> server started<br>
> 2014-03-03 14:33:51 CET LOG:  received SIGHUP, reloading configuration files<br>
> Connection to pool-3 closed.<br>
> postgres@pool-1:~$<br>
><br>
> Here is the script text:<br>
> ----------------------<br>
> #!/bin/sh<br>
><br>
> /usr/bin/logger Called "$0" "$*"<br>
><br>
> DEST=$1<br>
> DESTDIR=$2<br>
> PGCTL="/usr/lib/postgresql/9.3/bin/pg_ctl"<br>
><br>
> COMMAND="ssh -t postgres@$DEST '$PGCTL -w -D $DESTDIR start'"<br>
> /usr/bin/logger -- Trying "$COMMAND"<br>
> eval $COMMAND<br>
> ----------------------<br>
> Attila<br>
</div></div></blockquote></div><br></div>