parallel
[Top][All Lists]
Advanced

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

Re: tcgetattr: Invalid argument and --ctrl-c


From: Ole Tange
Subject: Re: tcgetattr: Invalid argument and --ctrl-c
Date: Sat, 11 May 2013 18:03:27 +0200

On Thu, May 9, 2013 at 8:11 PM, Fratkin, Allyn <allyn@hp.com> wrote:

> Perhaps the error is specific to Red Hat?  I reproduced it with remote hosts 
> running RHEL 5.2, 5.8, 6.3.  The local host is RHEL 5.8.
>
> ANY invocation of stty, even without arguments, provokes the "tcgetattr: 
> Invalid argument" error message.
>
> [afratkin@vl001 src]$ echo hello | ssh -tt -oLogLevel=quiet g4t0930c stty | 
> cat # RHEL 5.2
> tcgetattr: Invalid argument

The problem is not due to stty, but due to the version of ssh.

$ ./ssh -V
OpenSSH_3.6.1p2, SSH protocols 1.5/2.0, OpenSSL 0x1000100f
$ true | ./ssh -tt lo echo FOO
tcsetattr: Invalid argument
FOO
Connection to lo closed.

$ ssh -V
OpenSSH_5.9p1 Debian-5ubuntu1.1, OpenSSL 1.0.1 14 Mar 2012
$ true | ssh -tt lo echo FOO
FOO
Connection to lo closed.

The problem is due to this line in OpenSSH:

sshtty.c:
  enter_raw_mode(void):
  [...]
     if (tcsetattr(fileno(stdin), TCSADRAIN, &tio) == -1)
                perror("tcsetattr");

The error does not harm, but it would be nice if it was possible to
ignore it. I have not found a way.

I see several options:

  * live with the error on systems that use an old version of ssh

  * go back to the situation where --ctrl-c is not default (thus
ctrl-c will no propagate to remote hosts)

  * find a way to give each ssh a pty (openpty() looks promising
except it seems not to work on old versions of Perl). This might make
it possible to also propagate ctrl-z to suspend remote jobs if
parallel is suspended, which would be neat.

  * find a way to ignore the error in ssh. A dirty way of doing that
is when printing the cached stderr: Skip the first line if it is
"tcsetattr: Invalid argument". This would of course only work if
stderr is cached (i.e. not --ungroup).


/Ole



reply via email to

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