Re: [Queue-developers] Cross-platform termios handling...
Brought to you by:
wkrebs
From: W. G. K. <wer...@ya...> - 2000-08-20 02:41:55
|
Quoting Eric Deal <eri...@co...>: > > The particular problem I'm trying to address is the passing of > terminal settings when queueing a job from one platform to another. > One basic problem is that the job control file passes a binary > structure from the queue client to the queued server that > conveys the current state of the terminal at the client. > > When the platform is the same for both the client and server, > this works fine. Even if queue's terminal handling is not good, > the mechanism does work. > > Where this falls apart is when the client and server machines > are different platforms and the native termios structure differs. > In this case, major problems occur because the termios structures can > be arranged differently and have different lengths, which causes > the job control parsing to fail. > > So it seems that there are two underlying problems to be solved. > The first is how to abstract the terminal settings between platforms to > allow the passing of terminal settings from client to server, and the > second is whether queue should improve its general terminal handling. > > I'm fairly new to queue (cross-platform capability is a must before > it even becomes useful in my environment), so I don't have any opinion > on how well queue handles terminal settings. I'm also not familiar > with expect and how it handles terminals. > > So I'll repose the original question: > > 1) Does Expect have a modular way of handling terminal IO that could be > applied in Queue that would improve the Queue codebase? I'm not that familar with expect (Mike Castle's post was the first I'd heard of it), but it is a public domain scripting language for controlling interactive tasks developed by the U.S. government (NIST) for Unix and Windows. The URL is: http://expect.nist.gov/ . The examples directory lists expect scripts that use rlogin and telnet to perform an FTP-like function, run the "passwd" program non-interactively to set passwords for the system administrator, etc. Based on this description, it's unlikely that Expect sends terminal information over the network. (On the other hand, rlogin and telnet do send terminal information over the network, so perhaps we should look at the code base for these two programs. Ultimately, however, they will have to translate information to termios structures as well -- there's no way to completely get around this. Telnet and rlogin don't have to worry about their remotes being resumed or their local end being suspended by unexpected signals like tty in and then having to figure out how the terminal has changed, so they are solving a much simpler problem than Queue.) Expect's would probably be a good replacement for some of the stuff that goes on in pty.c, however. > 2) Does such a modular architecture change the method that terminal > settings would be exchanged between client/server machines such that > implementing a new terminal-handling scheme would make passing > settings easier than it currently can be done? > > I'd like to get other's input on this before coding up something that > might end up as a band-aid instead of doing this the right way. > > Eric > > >On Wed, Aug 16, 2000 at 11:02:54AM -0500, Eric Deal wrote: > >> I have a request for people running queue on various platforms. > >> Please send me a copy of the termios.h header file for platforms > >> that you are using. > > > >Of all the programs that I know that use terminals like this (queue, > >screen, expect), I've only seen one ever get it right. Expect. > > > >The last time I looked at queue and it's terminal stuff, because it wasn't > >working on my Linux box, I thought it was pretty much of a mess. > > > >I'd probably suggest that it all be ripped out and steal the stuff from > >expect, and try to track it as a reference source. No since reinventing > >the wheel when there is a perfectly good one you already use. > > > >mrc > >-- > > Mike Castle Life is like a clock: You can work constantly > > da...@ix... and be right all the time, or not work at all > >www.netcom.com/~dalgoda/ and be right at least twice a day. -- mrc > > We are all of us living in the shadow of Manhattan. -- Watchmen > > > >_______________________________________________ > >Queue-developers mailing list > >Que...@li... > >http://lists.sourceforge.net/mailman/listinfo/queue-developers > > > > > > _______________________________________________ > Queue-developers mailing list > Que...@li... > http://lists.sourceforge.net/mailman/listinfo/queue-developers > |