Quote:
Originally Posted by tonyfreeman
Hello,
Where is TERM set globally so that I can make sure it get's set to 'vt100' instead of 'linux'?
-- Tony
|
Well, it isn't set "globally". It's set by whichever program you use to login. But this gets complicated.
At the console, the program is "mingetty", and it sets the TERM to linux. The "mingetty" program is expected for use with consoles on Linux, so this is what you get. However, you can change this to the more sophisticated agetty command, with which you can set the TERM variable. For instance, to let inittab know you want console #1 to use vt100, you can do this:
1:12345:respawn:/sbin/agetty 57600 tty1 vt100
(Remember to run
init q after the changes.)
Both agetty and mingetty pass control to "login". In the case of RHEL4, login uses PAM to control security access. But PAM can also be used to set environment variables. You can set system-wide defaults (for ALL logins) in
/etc/security/pam_env.conf
Finally, you can use basic shell scripting to modify the environment variables. Simply change /etc/profile (or create a new file ending with .sh in /etc/profile.d/) to globally set the environment variable "TERM". Once the system restarts, TERM will be set globally. However, mingetty will override these settings, and sshd might clear them. But once your shell (bash) starts, /etc/profile will be again read and will pick up the new TERM settings. Example line:
TERM=vt100; export TERM
A word of caution: if you do change /etc/profile, you should also change csh.cshrc (or a file in /etc/profile.d ending with .csh). But this will use the "csh" syntax which is
setenv TERM vt100
Good luck!