LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices

Reply
 
Search this Thread
Old 02-20-2007, 01:22 PM   #1
tonyfreeman
Member
 
Registered: Sep 2003
Location: Fort worth, TX
Distribution: Debian testing 64bit at home, EL5 32/64bit at work.
Posts: 187

Rep: Reputation: 30
Where is global TERM variable set?


Hello,

I'm having a problem with RedHat EL 4.2 and the hb_stat program. The problem lies with the system's default TERM setting. The default TERM setting is 'linux' ... however I need this to be 'vt100' in order for hb_stat to report status to the terminal (nothing happens if the TERM is set to 'linux').

Where is TERM set globally so that I can make sure it get's set to 'vt100' instead of 'linux'?


-- Tony
 
Old 02-20-2007, 02:20 PM   #2
otheus
LQ Newbie
 
Registered: Jun 2006
Location: Austria
Distribution: RHEL AS 4
Posts: 25

Rep: Reputation: 16
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!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Shell Term variable help neilcpp Linux - Software 1 03-15-2006 07:14 AM
scp error, TERM env. variable not set? jimbo Linux - Networking 2 11-26-2005 01:31 AM
Set Global variable for daemon without login RX100 Linux - Software 3 10-08-2004 08:50 AM
Cron: TERM environment variable not set. hydro Linux - General 4 04-15-2004 10:59 PM
$TERM Variable Problems LinuxTechie Red Hat 2 11-02-2003 10:29 AM


All times are GMT -5. The time now is 07:12 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration