LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-19-2012, 02:36 AM   #1
vrs
LQ Newbie
 
Registered: Jul 2012
Posts: 21

Rep: Reputation: Disabled
'dumb': unknown terminal type:. error message


Hi
I am facing a weird problem, requesting experts to give some suggestion.

If I run a script which contains command “top –n1 –b > dump_text.txt” from bash or from command prompt, it works fine. (means all "top output" is dumped to dump_text.txt file)

However, when I run the same script during "boot up of the system", I get following error

'dumb': Unknown terminal type

After `googling`,I found several threads such as

http://www.unixguide.net/linux/faq/09.02.shtml
http://www.linuxquestions.org/questi...t-work-572162/

and did the following changes

echo " Current term is $TERM"
top -b -n1
export TERM=xterm
echo " Current term is $TERM"
top -b -n1
export TERM=console
echo " Current term is $TERM"
top -b -n1
export TERM=linux
echo " Current term is $TERM"
top -b -n1


and the result was as below
'dumb': unknown terminal type.
Current term is xterm
'dumb': unknown terminal type.
Current term is console
'dumb': unknown terminal type.
Current term is linux
'dumb': unknown terminal type.
'linux': unknown terminal type.

We have "heavily" tweaked Root file system and using older version of linux kernel (2.6.18) and upgrading kernel at current stage is not feasible. Unfortunately we do not have "ps" feature either. Considering the fact that if the script works fine from shell prompt / bash, I expect it to work during boot up also (just to add, "top" binary was present at that boot stage when script was running)

Considering above constraints, any suggestion would be very helpful.

Thanks in advance
 
Old 07-22-2012, 10:48 AM   #2
dmdeb
Member
 
Registered: Jul 2007
Location: Germany
Distribution: Debian
Posts: 45

Rep: Reputation: 6
Quote:
Originally Posted by vrs View Post
Hi
I am facing a weird problem, requesting experts to give some suggestion.
Hey vrs,

programs that simply output plain text to stdout should not even consider $TERM. Maybe you have a buggy version of top installed on your system?
See here: https://bugzilla.redhat.com/show_bug.cgi?id=130517

Regards
dmdeb
 
Old 07-22-2012, 03:50 PM   #3
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,624

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
Quote:
“top –n1 –b > dump_text.txt”
did you by chance forget that "_" underscore?

i hate using those , they are WAY TOO EASY TO MISS

Code:
top –n1 –b > /var/log/dump.txt
 
Old 07-22-2012, 10:53 PM   #4
vrs
LQ Newbie
 
Registered: Jul 2012
Posts: 21

Original Poster
Rep: Reputation: Disabled
First of all, thanks all (dmdeb/john) for their help/time for this issue.
i had tried with “top –n1 –b > dump.txt”, issue was still same.
Tried with exec (where script1 calls script2 and script2 does the `exec') and also with source, still same issue.

Intention of top was to figure out memory hogging process/pids, wrote a script which "cats" statm of each PID, reads 2nd field "RES ", converts PAGES to KB size and then divides by overall memory of the system( obtained by "getconf PAGESIZE").

The above solution worked fine without top usage .
 
Old 07-22-2012, 11:58 PM   #5
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,624

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
if all you want to do is find out what process is doing what at boot
why not just use "bootchart"
http://www.bootchart.org/
 
Old 07-23-2012, 12:02 AM   #6
vrs
LQ Newbie
 
Registered: Jul 2012
Posts: 21

Original Poster
Rep: Reputation: Disabled
Intention was to run a script which periodically runs and prints/captures memory hogging PID, could have done with "cron" but as said, RFS has been heavily tweaked and and "Cron" feature is also not available
 
Old 07-23-2012, 01:48 AM   #7
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,125

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Seems that it goes looking for some terminfo regardless. An strace of "top -n 1 -b " redirected to a text file on my F16 (was done from a X term BTW) shows it cycling through to /usr/share/terminfo/d/dumb. Which was provided by ncurses-base.

If you have a severely stripped system, you may not have even the barest defaults it's looking for.
 
Old 07-23-2012, 06:17 AM   #8
vrs
LQ Newbie
 
Registered: Jul 2012
Posts: 21

Original Poster
Rep: Reputation: Disabled
yes, but what puzzles me is that if the same command is given from shell command, it works fine..
thanks
 
Old 07-23-2012, 08:13 AM   #9
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,830

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
I think during the boot the top has no access to any terminfo (and related stuff), so it assumes the worst case, a dumb terminal.
 
  


Reply



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
Cron tab error: No entry for terminal type "unknown"; sing dumb terminal settings. shlomi.s Linux - Software 12 09-06-2011 09:20 AM
Error opening terminal: xterm Terminal type "xterm" unknown Pscylo Slackware 10 04-17-2009 06:33 AM
Error message on opening up a csh terminal in Fedora 9 Unknown colorls variable `ca'. mrground Linux - Software 3 08-01-2008 11:37 AM
linux: Unknown terminal type when doing vi packets Solaris / OpenSolaris 4 11-12-2007 11:08 PM
unknown terminal type BroX Linux - Networking 0 06-02-2004 04:04 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:10 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration