Operating System - HP-UX
1832095 Members
3224 Online
110038 Solutions
New Discussion

Using su, the value of LINES changes

 
Tom Byrne_1
New Member

Using su, the value of LINES changes

I use Reflections over ethernet to connect to various HP-UX boxes as a VT220 type terminal.

We use securetty to limit root login.

When I login as myself and examine the value of $LINES, it is correctly set to 24.

When I "su -" to root, the value of $LINES is now 4.

This only happens when the emulation mode is set to 8 bit. It does not happen with 7 bit.

Any ideas?

Thanks in advance!
4 REPLIES 4
A. Clay Stephenson
Acclaimed Contributor

Re: Using su, the value of LINES changes

Hi Tom:

This is my best guess. Look in root .profile. Do you see those tset commands? I think that is your culprit. When it queries your terminal it is probably getting back a terminial ID string and then acting on it. You can probably
either put some probes in the .profile to log what tset is doing to a file of do some tests to bypass the code if a Reflection connection is detected. I'll bet that it does not do this to you if you su root rather than su - root. That is a definite indication that it is the .profile.

Clay
If it ain't broke, I can fix that.
Sridhar Bhaskarla
Honored Contributor

Re: Using su, the value of LINES changes

Tom,

When you do a su - , root's .profile will get executed. Depending on the terminal definition there you would get the LINE, COLUMN settings. Check out $TERM once you did su -. If the TERM remains vt220, then do a resize and see if it is setting back to 24.

If you just do su (without -), the $LINES will remain.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Michael Tully
Honored Contributor

Re: Using su, the value of LINES changes

Hi,

You will probably find that there is some
reset from the 'tset' in your root user's
.profile and this can depend upon what
terminal type you are using when you run
the 'su -' command. Try and comment out the
lines pertaining to the 'tset' and test, or
alternatively add a variable of LINES=24 to
root's .profile.

HTH
-Michael
Anyone for a Mutiny ?
Wodisch
Honored Contributor

Re: Using su, the value of LINES changes

Hello Tom,

check for "tset" or "ttytype" in your
"/etc/profile", and your "$HOME/.profile"
and set LINES afterwards.

HTH,
Wodisch