zsh-users
 help / color / mirror / code / Atom feed
* error on TTY read: no such file or directory
@ 2001-09-11  0:07 lordzork
  2001-09-11 12:15 ` Borsenkow Andrej
  0 siblings, 1 reply; 11+ messages in thread
From: lordzork @ 2001-09-11  0:07 UTC (permalink / raw)
  To: zsh-users

this is very strange.

i login to the host in question as root from a tty device. lala, regular
login stuff, zshrc, ps1, etc. then, if i try to type something,
anything, i get

zsh: error on TTY read: no such file or directory

then it logs me out. note that i am not actually typing a full command
and hitting enter, i get the error after typing only one letter.

if i connect to the host via ssh or telnet, everything is fine. if i
login from a tty using a different shell (ie, bash or ash), everything
is fine. if i login from a tty with another account that uses zsh,
everything is fine. 

this annoying problem has me stumped! so if anyone has any ideas, i'd
love to hear them.

i make the following predictions:

1. the solution is completely obvious (only not to me).
2. i will feel like a complete idiot once this is pointed out.

well then!

-tmk


-- 
4.0k -rw-rw-r--    1 zork     zork       17 Apr 4 17:38 .signature


^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: error on TTY read: no such file or directory
  2001-09-11  0:07 error on TTY read: no such file or directory lordzork
@ 2001-09-11 12:15 ` Borsenkow Andrej
  2001-09-11 12:49   ` lordzork
  0 siblings, 1 reply; 11+ messages in thread
From: Borsenkow Andrej @ 2001-09-11 12:15 UTC (permalink / raw)
  To: lordzork, zsh-users


To all - PLEASE, indicate at least

- your Zsh version
- your operating system
- for Linux - distribution, and/or glibc version. Most people tend to
name kernel version but it hardly matters (in most cases).
- anything else you deem approrpiate

 
> this is very strange.
> 
> i login to the host in question as root from a tty device. lala,
regular
> login stuff, zshrc, ps1, etc. then, if i try to type something,
> anything, i get
> 
> zsh: error on TTY read: no such file or directory
> 
> then it logs me out. note that i am not actually typing a full command
> and hitting enter, i get the error after typing only one letter.
> 
> if i connect to the host via ssh or telnet, everything is fine. if i
> login from a tty using a different shell (ie, bash or ash), everything
> is fine. if i login from a tty with another account that uses zsh,
> everything is fine.
> 

I had similar problem under Mandrake cooker with specific version of
util-linux. The way login tried to "free" controlling terminal resulted
in process having *no* controlling terminal. Ash did not care, bash
tried to explicitly reopen stdin, zsh had problems. It looked different,
but may be it is attributed to different zsh version (I do not remember
what version I had at this time).

Please, login on other console and check zsh processes if they have
controlling tty. 


-andrej


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: error on TTY read: no such file or directory
  2001-09-11 12:15 ` Borsenkow Andrej
@ 2001-09-11 12:49   ` lordzork
  2001-09-11 14:01     ` Bart Schaefer
  0 siblings, 1 reply; 11+ messages in thread
From: lordzork @ 2001-09-11 12:49 UTC (permalink / raw)
  To: zsh-users

In the gothic chambers of the underworld on Tue 11 Sep 2001 at 08:15 -0400,
Borsenkow Andrej muttered darkly:

> 
> To all - PLEASE, indicate at least
> 
> - your Zsh version
> - your operating system
> - for Linux - distribution, and/or glibc version. Most people tend to
> name kernel version but it hardly matters (in most cases).
> - anything else you deem approrpiate
> 

zsh 4.0.2
linux kernel 2.4.7
glibc 2.2.3
util-linux-2.11h
shadow-20001016

i don't use a pre-packaged distro, so i suppose you can consider the
system to be generic gnu/linux.

> I had similar problem under Mandrake cooker with specific version of
> util-linux. The way login tried to "free" controlling terminal resulted
> in process having *no* controlling terminal. Ash did not care, bash
> tried to explicitly reopen stdin, zsh had problems. It looked different,
> but may be it is attributed to different zsh version (I do not remember
> what version I had at this time).

i use the login from the shadow package, so util-linux isn't the
problem. also, i have three other boxes with the exact config listed
above, and they work fine with zsh.

also, as i said, this problem happens *only* when i login as root, and
then only from a tty.
 
> Please, login on other console and check zsh processes if they have
> controlling tty. 

they do. 

t. 

-- 
4.0k -rw-rw-r--    1 zork     zork       17 Apr 4 17:38 .signature


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: error on TTY read: no such file or directory
  2001-09-11 12:49   ` lordzork
@ 2001-09-11 14:01     ` Bart Schaefer
  2001-09-28 16:13       ` lordzork
  0 siblings, 1 reply; 11+ messages in thread
From: Bart Schaefer @ 2001-09-11 14:01 UTC (permalink / raw)
  To: lordzork, zsh-users

On Sep 11,  8:49am, lordzork@lordzork.com wrote:
}
} also, as i said, this problem happens *only* when i login as root, and
} then only from a tty.

Please try adding

    ((UID)) || {
	set -x
	exec 2>|/tmp/login-trace
    }

to /etc/zshenv.  Then log in and let it boot you out.  Then log in again
(as someone other than root) and examine /tmp/login-trace to see whether
any unexpected commands are being executed.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: error on TTY read: no such file or directory
  2001-09-11 14:01     ` Bart Schaefer
@ 2001-09-28 16:13       ` lordzork
  2001-09-28 17:48         ` Bart Schaefer
  2001-09-29  6:41         ` Borsenkow Andrej
  0 siblings, 2 replies; 11+ messages in thread
From: lordzork @ 2001-09-28 16:13 UTC (permalink / raw)
  To: zsh-users

In the gothic chambers of the underworld on Tue 11 Sep 2001 at 10:01 -0400,
Bart Schaefer muttered darkly:

> On Sep 11,  8:49am, lordzork@lordzork.com wrote:
> }
> } also, as i said, this problem happens *only* when i login as root, and
> } then only from a tty.
> 
> Please try adding
> 
>     ((UID)) || {
> 	set -x
> 	exec 2>|/tmp/login-trace
>     }
> 
> to /etc/zshenv.  Then log in and let it boot you out.  Then log in again
> (as someone other than root) and examine /tmp/login-trace to see whether
> any unexpected commands are being executed.
> 

i see nothing out of the ordinary, just the normal reading of the
config files. and then, this:

+/root/.zsh/.zshrc:1> path=( /bin /sbin /usr/bin /usr/sbin
/usr/local/bin /usr/local/sbin /sys ) 
zsh: error on TTY read: no such file or directory
+/root/.zsh/.zlogout:1> sleep 5
 
so i don't know... this has me completely stumped. i've tried three
different kernel versions (2.4.{7,9,10}), i've recompiled zsh without
any cflags, and i've even reinstalled the entire system from scratch.
and yet the problem persists.


t.

-- 
4.0k -rw-rw-r--    1 zork     zork       17 Apr 4 17:38 .signature


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: error on TTY read: no such file or directory
  2001-09-28 16:13       ` lordzork
@ 2001-09-28 17:48         ` Bart Schaefer
  2001-09-28 20:35           ` lordzork
  2001-09-29  6:41         ` Borsenkow Andrej
  1 sibling, 1 reply; 11+ messages in thread
From: Bart Schaefer @ 2001-09-28 17:48 UTC (permalink / raw)
  To: lordzork, zsh-users

On Sep 28, 12:13pm, lordzork@lordzork.com wrote:
}
} i see nothing out of the ordinary, just the normal reading of the
} config files. and then, this:
} 
} +/root/.zsh/.zshrc:1> path=( /bin /sbin /usr/bin /usr/sbin
} /usr/local/bin /usr/local/sbin /sys ) 
} zsh: error on TTY read: no such file or directory

That's a really strange error.  It's coming from ZLE attempting to read
one byte from the tty file descriptor, which should have been correctly
opened long before that point (or else you should have seen a different
error, earlier).

Does the same error happen if you log in as someone else and then use
"su -" to start a root login shell?  Otherwise I'm out of ideas on how
to tell you to debug it.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: error on TTY read: no such file or directory
  2001-09-28 17:48         ` Bart Schaefer
@ 2001-09-28 20:35           ` lordzork
  2001-09-29  1:33             ` Bart Schaefer
  0 siblings, 1 reply; 11+ messages in thread
From: lordzork @ 2001-09-28 20:35 UTC (permalink / raw)
  To: zsh-users

In the gothic chambers of the underworld on Fri 28 Sep 2001 at 13:48 -0400,
Bart Schaefer muttered darkly:

> That's a really strange error.  It's coming from ZLE attempting to read
> one byte from the tty file descriptor, which should have been correctly
> opened long before that point (or else you should have seen a different
> error, earlier).
> 
> Does the same error happen if you log in as someone else and then use
> "su -" to start a root login shell?  Otherwise I'm out of ideas on how
> to tell you to debug it.
> 

the error only happens if i login from a tty. all of the following work
fine:

logging in through ssh
logging in as a different user and suing to root
changing shell to bash and then logging in and typing 'zsh -l'

one clarification: this *is* happening to every user, not just root.
it was just taking longer for the tty error to pop up with the other
users. i've noticed that this amount of time varies; sometimes it's
possible for me to type several commands before it boots me.

one other oddity is that command keys in less don't work properly. for
instance, pressing the down arrow prints '^[[B` instead of scrolling
down; pg down prints '^[[6~'. typing 'q' prints a q; a subsequent enter
will quit. it seems to me that this is somehow related to the tty read
error, since it is apparently affecting the line editor.

not to mention, i have the *exact* zsh setup on three other boxes, and
none of these problems.

for the curious, the login-trace file and related zsh configs can be
found here: http://lzi.n3.net/~zork/zle_error/

t.
 

-- 
4.0k -rw-rw-r--    1 zork     zork       17 Apr 4 17:38 .signature


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: error on TTY read: no such file or directory
  2001-09-28 20:35           ` lordzork
@ 2001-09-29  1:33             ` Bart Schaefer
  2001-09-29  2:16               ` lordzork
  0 siblings, 1 reply; 11+ messages in thread
From: Bart Schaefer @ 2001-09-29  1:33 UTC (permalink / raw)
  To: lordzork, zsh-users

On Sep 28,  4:35pm, lordzork@lordzork.com wrote:
} 
} the error only happens if i login from a tty.
} 
} one clarification: this *is* happening to every user, not just root.
} 
} one other oddity is that command keys in less don't work properly. for
} instance, pressing the down arrow prints '^[[B` instead of scrolling
} down; pg down prints '^[[6~'.

Aha.  This suggests that you may have the wrong kind of getty running
on those ttys.  For example, you may have mgetty or another flavor of
modem-oriented getty which is expecting a locking protocol to be used.
Check /etc/inittab or wherever it is that your gettys are configured.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: error on TTY read: no such file or directory
  2001-09-29  1:33             ` Bart Schaefer
@ 2001-09-29  2:16               ` lordzork
  0 siblings, 0 replies; 11+ messages in thread
From: lordzork @ 2001-09-29  2:16 UTC (permalink / raw)
  To: zsh-users

In the gothic chambers of the underworld on Fri 28 Sep 2001 at 21:33 -0400,
Bart Schaefer muttered darkly:

> Aha.  This suggests that you may have the wrong kind of getty running
> on those ttys.  For example, you may have mgetty or another flavor of
> modem-oriented getty which is expecting a locking protocol to be used.
> Check /etc/inittab or wherever it is that your gettys are configured.
> 

i use rungetty (http://www.ndn.net/rungetty.html?/). i use it on two of
my other linux boxes with no problem. 

just for kicks, i tried running agetty instead. same problem.

btw, i don't remember if i mentioned this before, but if i boot into
single user mode and login, everything is fine. of course, that uses
/dev/console instead of /dev/tty[1-7].

t.


-- 
4.0k -rw-rw-r--    1 zork     zork       17 Apr 4 17:38 .signature


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: error on TTY read: no such file or directory
  2001-09-28 16:13       ` lordzork
  2001-09-28 17:48         ` Bart Schaefer
@ 2001-09-29  6:41         ` Borsenkow Andrej
  2001-09-29  7:49           ` lordzork
  1 sibling, 1 reply; 11+ messages in thread
From: Borsenkow Andrej @ 2001-09-29  6:41 UTC (permalink / raw)
  To: lordzork; +Cc: zsh-users

lordzork@lordzork.com wrote:

> 
> i see nothing out of the ordinary, just the normal reading of the
> config files. and then, this:
> 
> +/root/.zsh/.zshrc:1> path=( /bin /sbin /usr/bin /usr/sbin
> /usr/local/bin /usr/local/sbin /sys ) 
> zsh: error on TTY read: no such file or directory
> +/root/.zsh/.zlogout:1> sleep 5
>  
> so i don't know... this has me completely stumped. i've tried three
> different kernel versions (2.4.{7,9,10}), i've recompiled zsh without
> any cflags, and i've even reinstalled the entire system from scratch.
> and yet the problem persists.
> 


Please, login (as root) on another tty and do strace on mingetty on, 
say, tty1 and then login on tty1. Do strace -f to follow all forks. This 
may give some hint (it did for me once I had similar problem).

-andrej


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: error on TTY read: no such file or directory
  2001-09-29  6:41         ` Borsenkow Andrej
@ 2001-09-29  7:49           ` lordzork
  0 siblings, 0 replies; 11+ messages in thread
From: lordzork @ 2001-09-29  7:49 UTC (permalink / raw)
  To: zsh-users

In the gothic chambers of the underworld on Sat 29 Sep 2001 at 02:41 -0400,
Borsenkow Andrej muttered darkly:

> 
> Please, login (as root) on another tty and do strace on mingetty on, 
> say, tty1 and then login on tty1. Do strace -f to follow all forks. This 
> may give some hint (it did for me once I had similar problem).
> 
> -andrej

yes, it does indeed:

ioctl(10, 0x541b, [0])                  = 0
ioctl(10, 0x5410, [1321])               = 0
ioctl(10, SNDCTL_TMR_STOP, {B9600 opost isig -icanon -echo ...}) = 0
write(10, "\r\33[m\33[m\33[m\33[J\n\33[1;30m[ \33[1;37mlc"..., 270) = 270
write(10, "\33[K", 3)                   = 3
read(10, "@(\377\4\10\0\0\0\0\361\212\0@8Q\1@B\5\0\0@W\1@\2\217\0"..., 1) = 1025
ioctl(2, SNDCTL_TMR_TIMEBASE, 0xbffff8d8) = -1 ENOTTY (Inappropriate ioctl for device)
write(2, "zsh: error on TTY read: bad file"..., 44) = 44
stat64("/root/.zsh/.zlogout.zwc", 0xbffff73c) = -1 ENOENT (No such file or directory)
stat64("/root/.zsh/.zlogout", {st_mode=S_IFREG|0644, st_size=8, ...}) = 0

etc

inappropriate ioctl for device? what does this mean? a search on google
doesn't seem to turn up much.

t.

-- 
4.0k -rw-rw-r--    1 zork     zork       17 Apr 4 17:38 .signature


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2001-09-29  7:50 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-09-11  0:07 error on TTY read: no such file or directory lordzork
2001-09-11 12:15 ` Borsenkow Andrej
2001-09-11 12:49   ` lordzork
2001-09-11 14:01     ` Bart Schaefer
2001-09-28 16:13       ` lordzork
2001-09-28 17:48         ` Bart Schaefer
2001-09-28 20:35           ` lordzork
2001-09-29  1:33             ` Bart Schaefer
2001-09-29  2:16               ` lordzork
2001-09-29  6:41         ` Borsenkow Andrej
2001-09-29  7:49           ` lordzork

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).