Operating System - HP-UX
1848395 Members
3200 Online
104026 Solutions
New Discussion

Setting the default term type on tty ports

 
SOLVED
Go to solution
Brad Andriese
Advisor

Setting the default term type on tty ports

System: HP-UX 11.0 on L2000 New Installation

I need to set the default terminal type for serial (tty) connections to vt100. The snippet below from the man pages on getty says:
____________
getty(1M)
/usr/sbin/getty [-h] [-t timeout] line [speed [type [linedesc]]]
type
The default terminal is none; i.e., any crt or normal terminal unknown to the system. Also, for terminal type to have any meaning, the virtual terminal handlers must be compiled into the operating system. They are available, but not compiled in the default condition.
____________

How do compile them into the "operating system?" I assume this means a driver in the kernel. What would the name be?

Is there another way for me to make sure that terminal connections are vt100 by default?

Thanks,

-Brad

Will give just do points.
Remember, usability is key to sucessful computing!
4 REPLIES 4
Brad Marks
Super Advisor

Re: Setting the default term type on tty ports

Hi Brad.
Term type can be set in .profile and exported.
e.g. TERM=vt100; export $TERM

Hope this helps,
Brad
It's not impossible -- it'll just cost more...
Brad Andriese
Advisor

Re: Setting the default term type on tty ports

The term variable is already set in the .profile using the folowing:

if [ "$TERM" = "" ]
then eval ` tset -s -Q -m ':?vt100'` else
eval ` tset -s -Q `
fi

However, when someone logs in via a terminal (i.e.: Telnet is ok) durring login the system says "terminal type unknown." Which makes me think I need to tell the system, not the users session what the default terminal type should be. Also, getty (above) talkes about loading things into the kernel. Something tells me there is more to this than just setting "TERM," but I don't know what driver to load or exactly how to go about fixing this problem.
Remember, usability is key to sucessful computing!
Bill Hassell
Honored Contributor
Solution

Re: Setting the default term type on tty ports

This is not a driver or kernel issue. TERM is an environment variable that helps shells and applications handle the hundreds of different terminals and emulators.

Under normal network logins (telnet), the terminal type is negotiated with the telnet daemon and the originator. Some telnet code fails to provide a terminal value and sometimes telnetd will set TERM=unknown. No problem as /etc/profile should be coded to handle this situation:

if [ "$TERM" = "$UNSET" -o "$TERM" = "unknown" -o "$TERM" = "dialup" -o "$TERM" = "network" ]
then
eval $(/sbin/ttytype -s)
fi

ttytype will attempt to guess what type of terminal is being used. It does this by sending common query codes and if no response, tries others. If all your terminals and/or emulators are truly dumb then you can hardcode the TERM value in /etc/profile with just:

export TERM=vt100

Now I indicated this works on 'normal' Unix logins through modems, terminals and telnet. Tools like remsh or Xwindows bypass these tests and you'll need to accomodate them differently.


Bill Hassell, sysadmin
Wieslaw Krajewski
Honored Contributor

Re: Setting the default term type on tty ports

Hi,

Just a few words to add to previous answers that relate to more general case. Especially Bill' answer is full.
But in Bradd's question serial terminals are mentioned.
In the previous versions of HP-UX it could be possible to connect type of terminal with a serial line in a file
/etc/ttytype. Although i didn't try it in HP-UX11 I hope this works as previously. Syntax of /etc/ttytype is simple, in the first field type of terminal should be put and serial line in the second field.

Hope this helps.

Rgds.
Permanent training makes master