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

Re: login and bash on a hardwired terminal.



On Fri, 7 Jun 1996, Dale Scheetz wrote:

> On Fri, 7 Jun 1996, Steve Preston wrote:
> 
> Ok! We are narrowing the field. 
> 
> The above command locks up the terminal big time, but...
> 
> stty cs7 cstopb
> 
> fixes it!
> 
> Now the question is: How do I get login to leave the stop bits alone?
> I can put the above command into .bashrc, but this will not fix login and
> I will still get the bunged password prompt.
> Looks like it's time to talk with Guy :-)

Sounds like you've nearly got it working, but here's a tip for you:

Rather than change s/w settings on the unix box, change the setup on the
terminal(s) so that they are as 'standard' as possible.  This means, if
the terminal setup allows it, set them to 8 data bits, 1 stop bit, no
parity.  Also, unless the term's native mode provides features you need,
set the terminal to emulate vt-100 or similar.

This way, you (or whoever logs in on the terminal) can avoid having
to have special case stuff in ~/.bashrc, ~/.bash_profile to set the
environment properly according to where they've logged in from.

It also follows the KISS principle - Keep It Simple Stupid - which i've
found is a damn good principle to follow :-)



i went down the same 'terminals are cheap/free so use them' path when
i first started with linux a few years ago...in fact, multi-user &
cheap/free dumb terminals was one of the main reasons i originally
switched to linux.  

So if you're still having troubles email me and i'll do what i can to help
you out.  email me directly...i just accepted a new job and dont have as
much time to read the mailing lists as i used to. 


Another way of doing it:
------------------------

If you CAN'T for some reason set the terminal as above, then you'll have
to edit /etc/rc.boot/0setserial to do an 'stty cs7 cstopb' or whatever
else is needed on the terminal.  Setting the line characteristics of
a hardwired terminal should be done BEFORE getty or login run on the
terminal - i.e. during the bootup process.

Also, if you do this you might want to put something like the following
in /etc/profile, to force the right settings every time someone logs in
(just in case the previous logged in user mucked up the stty settings):

if [ "`tty`" = "/dev/ttyS1" ] ; then
  stty cs7 cstopb
  alias exit='stty cs7 cstopb ; exit'
  alias logout='stty cs7 cstopb ; logout'
fi

This runs the right stty command at login, and aliases 'exit' and 'logout'
to make sure they're set properly on logout.

Craig


Reply to: