parallel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Re: use parallel for ssh -tt "xxxx"


From: sosogh
Subject: Re: Re: use parallel for ssh -tt "xxxx"
Date: Fri, 28 Aug 2015 15:04:54 +0800


   >> parallel -a iplist.txt 'ssh -qtt {} "sudo whoami" </dev/null'
   >> parallel -a iplist.txt 'ssh -qtt {} "sudo whoami"' </dev/null
   >> cat iplist.txt | parallel 'ssh -qtt {} "sudo whoami"'
 
Thank you .
 
I  have a strange problem ,
if     cat iplist.txt | parallel 'ssh -qtt {} "sudo /usr/sbin/userdel  -rf abcuser " '    , it still freeze ,
but sudo other cmd  will work well .
 
 
 
 

sosogh
 
From: Ole Tange
Date: 2015-08-23 12:05
To: sosogh
Subject: Re: use parallel for ssh -tt "xxxx"
On Fri, Aug 21, 2015 at 4:01 AM, sosogh <sosogh@mail.com> wrote:
 
> without -tt in ssh ,everything goes well:
>  parallel    -a   iplist.txt   ' ssh -q {}  "whoami" '
>
>  but with -tt , parallel will not exit , it will freeze there when finishing
> the last job.
>  parallel    -a   iplist.txt   ' ssh -qtt  {}  "sudo whoami"   '
>
>  why I need -tt is to work around  "ssh sudo: sorry, you must have a tty to
> run sudo".
 
The work around is:
 
    parallel -a iplist.txt 'ssh -qtt {} "sudo whoami" </dev/null'
    parallel -a iplist.txt 'ssh -qtt {} "sudo whoami"' </dev/null
    cat iplist.txt | parallel 'ssh -qtt {} "sudo whoami"'
 
The reason for your problems is due to the first job gets STDIN as its
controlling tty (from man parallel):
 
                stdin (standard input) will be passed to the first process run.
 
I seem to remember it was implemented to be compatible with some xargs
situation.
 
 
/Ole
 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]