Package: pssh
Version: 1.4.3-1

Hello,

Steps to reproduce :

1) create a hosts.txt file
touch /tmp/hosts.txt # you can put hosts in it, or leave it empty

2) run pssh normaly
parallel-ssh -h /tmp/hosts.txt ls # it works well

3) create a simple script calling pssh
vi /tmp/test.sh
chmod a+x /tmp/test.sh
cat /tmp/test.sh
#!/bin/sh
parallel-ssh -h /tmp/hosts.txt ls

4) run the script
/tmp/test.sh  # it hangs until killed
killall test.sh

Looking in the code in /usr/bin/parallel-ssh, it blocks at line 143 in the buffer_input() function :
stdin = sys.stdin.read()

To work around the problem, I applied the following patch :

--- /tmp/parallel-ssh   2009-09-30 21:44:59.000000000 +0200
+++ /usr/bin/parallel-ssh       2009-09-30 21:45:29.000000000 +0200
@@ -151,7 +151,7 @@
        os.makedirs(flags["outdir"])
    if flags["errdir"] and not os.path.exists(flags["errdir"]):
        os.makedirs(flags["errdir"])
-    stdin = buffer_input()
+    stdin = ""
    sem = threading.Semaphore(flags["par"])
    threads = []
    for i in range(len(hosts)):

In fact, pssh in also designed to be called with a pipe this way :
cat file_to_send | parallel-ssh -h /tmp/hosts.txt COMMAND_READING_STDIN
example useless command :
cat file_to_send | parallel-ssh -h /tmp/hosts.txt grep search_string

As I do not use this, I use my patch to call pssh from scripts.

But If we don't want to loose the "pipe" feature, we have to find a better patch.

Any idea ?

Marc



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to