[pgpool-general: 4844] Re: failover_command and follow_command does not exit and hangs indefinitely

Tema Zelikin gunslinger at nightflame.info
Tue Aug 2 19:35:11 JST 2016


02.08.2016 11:42, Tatsuo Ishii пишет:
>> 02.08.2016 11:12, Tatsuo Ishii пишет:
>>>
>>> I'm not familiar with Python but I guess at leat you should redirect
>>> stdin and stdout to /dev/null for this ssh. Pgpool-II executes fail
>>> over command by using system(3).
>>>
>>>         promote_command = ssh + 'postgres@' + pgnodemaster + ' /usr/bin/repmgr standby promote'
>>>
>>>     follow_command = ssh + 'postgres@' + sys.argv[2] + ' /usr/bin/repmgr standby follow'
>>>
>>> To do that, see this page for example:
>>>
>>> http://stackoverflow.com/questions/1628204/how-to-run-a-command-in-background-using-ssh-and-detach-the-session
>>>
>> But then, how would i know that command has finished its run?
> You can redirect stderr/stdout to a log file.

Ok, i rewrote my script.
I solved a problem with ssh (adding multiple -t options, which force it
to allocate remote tty).
Ansible still does not exit gracefully, but it can be worked around by
killing its processes in script.
Now i have another problem: why does pgpool execute failover script
multiple times?!
I'm attaching new version of the script and pgpool.log, which shows
double execution of failover_command.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pgpool.log
Type: text/x-log
Size: 80421 bytes
Desc: not available
URL: <http://www.sraoss.jp/pipermail/pgpool-general/attachments/20160802/cc62a28b/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: postgres.py
Type: text/x-python
Size: 3770 bytes
Desc: not available
URL: <http://www.sraoss.jp/pipermail/pgpool-general/attachments/20160802/cc62a28b/attachment-0001.py>


More information about the pgpool-general mailing list