- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Console keeps resetting to "hp" when using vt1...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-13-2010 02:08 PM
тАО05-13-2010 02:08 PM
In root .profile we have this
if [ "$TERM" = "" ]
then
eval ` tset -s -Q -m ':?hp' `
else
eval ` tset -s -Q `
fi
We have changed ?hp to ?vt100, and that will work when running the command manually, but not when you logoff, and back on.
We also have /etc/profile
# set term if it's not set
# if [ "$TERM" = "" -o "$TERM" = "unknown" -o "$TERM" = "dialup" \
# -o "$TERM" = "network" ]
# then
# eval `ttytype -s -a`
# fi
# export TERM
if [ -z "$TERM" ]
then
case $TERM in
50) TERM=wy50
;;
50+) TERM=wy50
;;
wy50|vt100|vt220) : #do nothing
;;
*) eval `tset -s -Q ` #look in ttytype
if [ -z "$TERM" -o "$TERM" = "unknown" ]
then
eval ` tset -s -Q -m ':?wy50' `
fi
;;
esac
fi
We did not change anything in /etc/profile.
Then we also have /etc/csh.login with
if ( ! $?TERM ) then # if TERM is not set,
setenv TERM hp # use the default
endif
Our GSP is already set at VT100, and everything works great after we manually change $TERM to "vt100". So what do I need to fix for it to automatically choose vt100?
Thanks.
Solved! Go to Solution.
- Tags:
- term
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-13-2010 02:49 PM
тАО05-13-2010 02:49 PM
Re: Console keeps resetting to "hp" when using vt100
*) eval `ttytype -s -a` #look in ttytype
if [ -z "$TERM" -o "$TERM" = "unknown" ]
then
eval ` tset -s -Q -m ':?vt100' `
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-13-2010 03:21 PM
тАО05-13-2010 03:21 PM
Re: Console keeps resetting to "hp" when using vt100
The second problem is the 20 year old tset command that is lousy at identifying terminals (well, today they are emulators). So the fix is to *SCRAP ALL* of that code starting at the
if [ "$TERM" ]
or
if [ -z "$TERM" ]
and replace it with this simple incantation:
eval $(ttytype -s)
ttytype will identify ancient and modern terminals (and emulators) by using the 3 major categories of terminal family (Wyse, HP and VT/ANSI) model queries. You'll see the the queries as they timeout (1 sec each) when you run the command manually:
# ttytype -s
TERM='vt100'; export TERM;
LINES=24; export LINES;
COLUMNS=80; export COLUMNS;
ERASE='^?'; export ERASE;
And if the use of scummy csh is not optional, the code looks exactly the same for csh.login:
eval $(ttytype -s)
Now all will be well through network logins. And although ttytype is a great tool, the man page still has the obsolete test for $TERM already set. ALWAYS test the terminal at login and never hardcode TERM=something unless ttytype -s cannot identify your device.
Oops: Enter the GSP and MP.
Prior to the GSP/MP interface to the system hardware (ie, the classic console), ttytype worked flawlessly. But with very questionable designs in the GSP/MP code, cursor controls (and thus terminal compatibility issues) crept in (vfp is an example). But the GSP/MP could not automatically identify the terminal so two hardcoded settings were part of the GSP/MP, hp and vt100. So far so good as long as the console device matched the hardcoded GSP/MP setting.
But somewhere around 10.20/11.00 releases, the ttytype (and tset) code was changed to stop querying the console device and instead hardcode TERM to the GSP/MP value. So regardless of the type of terminal connected to the console, it is now ignored. I am sure the designers were trying to accommodate multiple connections through the LAN interface, but this would have been unnecessary if special escape sequences (cursor control, clear screen, etc) were dropped in favor of POA (Plain Old ASCII).
So we're stuck with a special case for all console connections. While I love the smart terminal features of the HP terminals and hpterm (upon which the PCL printer language is based), the momentum of the truly dumb terminal vt100 is too pervasive so it's time to drop real HP terminals (and emulators such as QCTerm and Reflection/HP) and lose the 2-line softkey labels and plethora of character enhancements. This recommendation is only for sysadmins that must by necessity be connected to the real console. Normal users can always run Wyse, HP, Tektronix, whatever on non-console connections.
So set all your GSP/MP interfaces to vt100 and adopt a smart vt100 emulator such as PuTTY. There are many "vt100" emulators out there, some are very expensive and some (like PuTTY) are free. In conjunction with a PuTTY config manager, you can easily handle hundreds of machines and the occasional DEL vs BS issue which is resolved in PuTTY settings.
Bill Hassell, sysadmin
- Tags:
- scummy C shell
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-13-2010 03:44 PM
тАО05-13-2010 03:44 PM
Re: Console keeps resetting to "hp" when using vt100
My apologies to csh users...the syntax is simply:
eval ttytype -s
One additional note about the changes in ttytype:
If you run the command ttytype -s on the GSP/MP, you may see it truncated:
# ttytype -s
TERM='vt100'; export TERM;
ERASE='^?'; export ERASE;
Most experienced sysadmins will run at least 132 column screens to handle long lines. But try to login through the console and you won't get COLUMNS and LINES updated. That will break vi and many other menu programs.
You need to follow ttytype with resize which thankfully, was not hacked for the GSP/MP interface (it's protected by Xwindows):
eval $(ttytpe -s)
eval $(/usr/bin/X11/resize)
or a 1-liner:
eval $(ttytype -s;/usr/bin/X11/resize)
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-13-2010 04:02 PM
тАО05-13-2010 04:02 PM
Re: Console keeps resetting to "hp" when using vt100
In /etc/profile just use:
eval $(ttytype -s;/usr/bin/X11/resize)
and in /etc/csh.login use:
eval ttytype -s;/usr/bin/X11/resize
Do I need to update all the .profile files in each of the users directories to also just use:
eval $(ttytype -s;/usr/bin/X11/resize)
?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-13-2010 07:14 PM
тАО05-13-2010 07:14 PM
SolutionTo propagate the change to any new users, also change .profile in /etc/skel. This directory is copied to each new user's $HOME directory using sam/smh or useradd.
However, since each user will go through /etc/profile, .profile doesn't need to run ttytype again. It will delay login slightly.
If you are using (or plan to use) batch jobs that use su - to change user, you'll need to protect the terminal-only commands such as:
ttytype
tput
stty
tabs
There is a command: tty
that will return 0 when the session is connected to a real terminal. Something like this:
if tty
then
eval $(ttytype -s;/usr/bin/X11/resize)
tabs
stty erase "^H" kill "^U" intr "^C" eof "^D"
stty -parity ixoff susp \^Z dsusp \^Y
cat /etc/motd
echo "See copyright notice at: /etc/copyright"
export PS1='# '
fi
The above code will keep a lot of junk messages from showing up in syslog and email.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-14-2010 12:08 PM
тАО05-14-2010 12:08 PM
Re: Console keeps resetting to "hp" when using vt100
if tty
then
eval ttytype -s;/usr/bin/X11/resize
tabs
stty erase "^H" kill "^U" intr "^C" eof "^D"
stty -parity ixoff susp \^Z dsusp \^Y
cat /etc/motd
echo "See copyright notice at: /etc/copyright"
export PS1='# '
fi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-14-2010 12:16 PM
тАО05-14-2010 12:16 PM
Re: Console keeps resetting to "hp" when using vt100
Replace:
# if tty
With:
# if [ -t 0 ]
This tests STDIN (file descriptor 0) to determine if it is associated with a 't'erminal.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-14-2010 12:31 PM
тАО05-14-2010 12:31 PM
Re: Console keeps resetting to "hp" when using vt100
in /etc/profile
if tty
then
eval $(ttytype -s;/usr/bin/X11/resize)
tabs
stty erase "^H" kill "^U" intr "^C" eof "^D"
stty -parity ixoff susp \^Z dsusp \^Y
echo "Value of TERM has been set to \"$TERM\". "
cat /etc/motd
echo "See copyright notice at: /etc/copyright"
export PS1='# '
fi
in /etc/csh.login
if [ -t 0 ]
then
eval ttytype -s;/usr/bin/X11/resize
tabs
stty erase "^H" kill "^U" intr "^C" eof "^D"
stty -parity ixoff susp \^Z dsusp \^Y
echo "Value of TERM has been set to \"$TERM\". "
cat /etc/motd
echo "See copyright notice at: /etc/copyright"
export PS1='# '
fi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-02-2010 03:16 PM
тАО06-02-2010 03:16 PM
Re: Console keeps resetting to "hp" when using vt100
$ ttytype -s
setenv TERM vt320;
setenv LINES 24;
setenv COLUMNS 80;
setenv ERASE ^?;
The last statement will produce an error as the question mark isn't quoted. Tested in 11.00 and 11.23. Maybe there's an easy work-around I'm overlooking?