<div dir="ltr"><div><div>Thanks the sample! <br><br></div>I have tried &quot;-t&quot; and &quot;-T&quot; also for ssh, but none helped.<br>Also I have tried your recommendation without the trailing &quot;&amp;&quot;, 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 &quot;$0&quot; &quot;$*&quot;<br>


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


<br>eval $COMMAND<br><br>/usr/bin/logger -- Leaving &quot;$0&quot;<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">&lt;<a href="mailto:ishii@postgresql.org" target="_blank">ishii@postgresql.org</a>&gt;</span>:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">You specify &quot;ssh -t&quot; 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&#39;m using.<br>
-------------------------------------------------------------------------------<br>
#! /bin/sh<br>
#<br>
# start postmaster on the recovered node<br>
#<br>
if [ $# -ne 2 ]<br>
then<br>
    echo &quot;pgpool_remote_start remote_host remote_datadir&quot;<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&gt;/dev/null 1&gt;/dev/null &lt; /dev/null &amp;<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>
&gt; Dear Guys,<br>
&gt;<br>
&gt; I have got a problem...<br>
&gt;<br>
&gt; I started to use pgpool2 3.3 with postgresql 9.3 on Debian 7.3, using the<br>
&gt; pgpool/postgresql repositories.<br>
&gt;<br>
&gt; I have setup a cluster of two pgpool2 nodes and three backend databases. It<br>
&gt; works in a way after setup, but when I started to test the steps that<br>
&gt; should be done for recovery/adding a node, I have ran into the following<br>
&gt; problem:<br>
&gt;<br>
&gt; When pgpool starts the pgpool_remote_start script, it never returns. After<br>
&gt; the end of the scripts, pcp_recovery_node waits until the end of time.<br>
&gt;<br>
&gt; Running the script by hand always work.<br>
&gt;<br>
&gt; postgres@pool-1:~$ /usr/sbin/pcp_recovery_node -d 0 localhost 9898 postgres<br>
&gt; DifficultPassword 2<br>
&gt; DEBUG: send: tos=&quot;R&quot;, len=46<br>
&gt; DEBUG: recv: tos=&quot;r&quot;, len=21, data=AuthenticationOK<br>
&gt; DEBUG: send: tos=&quot;D&quot;, len=6<br>
&gt;<br>
&gt; ... and just waits forever...<br>
&gt;<br>
&gt; Meanwhile the remote postgresql DB is up and running:<br>
&gt;<br>
&gt; postgres@pool-3:~$ /usr/lib/postgresql/9.3/bin/pg_ctl -w -D<br>
&gt; /var/lib/postgresql/9.3/main/ status<br>
&gt; pg_ctl: server is running (PID: 8780)<br>
&gt;<br>
&gt;<br>
&gt; The pgpool_remote_start script is:<br>
&gt; postgres@pool-1:~$ /var/lib/postgresql/pgpool_remote_start pool-3<br>
&gt; /var/lib/postgresql/9.3/main/<br>
&gt; waiting for server to start....2014-03-03 14:33:50 CET LOG:  database<br>
&gt; system was shut down at 2014-03-03 14:33:42 CET<br>
&gt; 2014-03-03 14:33:50 CET LOG:  database system is ready to accept connections<br>
&gt; 2014-03-03 14:33:50 CET LOG:  autovacuum launcher started<br>
&gt;  done<br>
&gt; server started<br>
&gt; 2014-03-03 14:33:51 CET LOG:  received SIGHUP, reloading configuration files<br>
&gt; Connection to pool-3 closed.<br>
&gt; postgres@pool-1:~$<br>
&gt;<br>
&gt; Here is the script text:<br>
&gt; ----------------------<br>
&gt; #!/bin/sh<br>
&gt;<br>
&gt; /usr/bin/logger Called &quot;$0&quot; &quot;$*&quot;<br>
&gt;<br>
&gt; DEST=$1<br>
&gt; DESTDIR=$2<br>
&gt; PGCTL=&quot;/usr/lib/postgresql/9.3/bin/pg_ctl&quot;<br>
&gt;<br>
&gt; COMMAND=&quot;ssh -t postgres@$DEST &#39;$PGCTL -w -D $DESTDIR start&#39;&quot;<br>
&gt; /usr/bin/logger -- Trying &quot;$COMMAND&quot;<br>
&gt; eval $COMMAND<br>
&gt; ----------------------<br>
&gt; Attila<br>
</div></div></blockquote></div><br></div>