Altiscale / pdsh

Automatically exported from code.google.com/p/pdsh
GNU General Public License v2.0
0 stars 0 forks source link

Support forwarding stdin in pdsh #3

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago

From an sf.net user:

"It would be nice, if pdsh could be used in a pipe. For example:

 $ echo foo bar | pdsh -w host1,host2 md5sum"

In order to support anything like this, pdsh first needs to support
broadcasting of stdin. This is on the TODO list, but is low priority
at the moment.

Original issue reported on code.google.com by mark.gro...@gmail.com on 10 Sep 2010 at 4:36

GoogleCodeExporter commented 9 years ago
Mark,

I vote for this, too ( presuming i wasn't the sf.net user ;) ). (i'm not just 
+1 Me Too... i have a use case here that may be of more real use than the 
md5sum example above)

Right now, i'm trying to do a simplistic encrypted password changer for the 
root account that doesn't end up putting the encrypted password onto the 
arglist for the process.

$ UMASK=077 echo "root:ENCRYPTEDPASSWD" > ${HOME}/pw.txt
$ pdsh -Rexec HOST-SPEC /bin/sh -c 'ssh root@%h /usr/sbin/chpasswd -e < 
${HOME}/pw.txt'

is the closest thing to doing this.

It'd be desireable to:

echo "root:ENCRYPTEDPASSWD" | pdsh HOST-SPEC --dup-stdin '/usr/sbin/chpasswd -e'
(presuming 'echo' is a shell builtin, or client machine is secured 
single-user...)

But, yeah, it's definitely a LOW priority item.

thanks,
--stephen

Original comment by stephen....@gmail.com on 2 Nov 2011 at 10:43

GoogleCodeExporter commented 9 years ago
Thanks for the added use case. It is on my TODO list, but pdsh doesn't get too 
much attention lately.

Original comment by mark.gro...@gmail.com on 2 Nov 2011 at 11:07