LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 04-10-2010, 02:49 PM   #1
Dogs
Member
 
Registered: Aug 2009
Location: Houston
Distribution: Slackware 13.37 x64
Posts: 105

Rep: Reputation: 25
Dear friends at LQ, I have a simple question(really!)


I want to have a errors from any program I'm running dumped to a console (errors in kernel, errors in inetd, or what have you).

The reason is - Error messages help me learn. How do I overwhelm myself with debugging information?
 
Old 04-10-2010, 02:58 PM   #2
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hi,

One option would be to tail the log files of the various programs. I think that would be the simplest since you wouldn't have to change any config. If you use tail -f then you can 'follow' what gets written to the logs.

If you're talking about programs you start manually that don't have a log assigned to it, the see if you can run it with -v option (verbose). That prints out lots of information too if available.

Kind regards,

Eric
 
Old 04-11-2010, 01:57 PM   #3
Dogs
Member
 
Registered: Aug 2009
Location: Houston
Distribution: Slackware 13.37 x64
Posts: 105

Original Poster
Rep: Reputation: 25
I don't mind changing configs at all. I'm actually doing this, in-part, to locate all the config files.


In the /etc/syslog.conf file I found this line -

Quote:
# Uncomment this to see kernel messages on the console.
#kern.*
which will print kernel messages in the console when they're generated. The cool part about this feature is -

When I write a program that overruns array boundaries, I get kernel messages stating the where and the what just screwed up. I'm looking for more of that. (so that no matter what error happened, I get to read about it.)


I'm going to write a shell script to tail all the log files, but I really was hoping for more real-time reporting, such as the kernel message example.


I'd also love to be able to step through the execution of the kernel with a debugger.
 
Old 04-11-2010, 02:22 PM   #4
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
Quote:
Originally Posted by Dogs View Post
I don't mind changing configs at all. I'm actually doing this, in-part, to locate all the config files.


In the /etc/syslog.conf file I found this line -
The problem is that there are many ways to log info. Most *nix programs will use the syslog facilities, in that case it should be simple to get their logs just by correctly configuring the relevant programs and/or the system logger.

Quote:
I'm going to write a shell script to tail all the log files, but I really was hoping for more real-time reporting, such as the kernel message example.
Not sure what do you mean. "tail -f" is as real time as your kernel can get, meaning that any change to a given log file which is being tailed with -f will be printed as soon as the tail tool perceives the change in the file, which virtually means "instantly".

Just fire up "tail -f /var/log/messages" in xterm to see what I mean. As soon as a new kernel message is generated it should be printed to that xterm window.

Quote:
I'd also love to be able to step through the execution of the kernel with a debugger.
Kernel debugging is not a trivial thing, and it needs support on the kernel side which must be enabled before you compile it. The kind of options you'll need to turn on will depend on what exactly do you want to debug inside the kernel, and I am not the most adequate person to give you advice about that.

For this one you should better ask in the kernel subforum.
 
Old 04-11-2010, 05:28 PM   #5
Dogs
Member
 
Registered: Aug 2009
Location: Houston
Distribution: Slackware 13.37 x64
Posts: 105

Original Poster
Rep: Reputation: 25
I guess what I really want to do is watch how the system works. I want to see step-by-step what the PC is doing, what problems it is having, how it is handling those problems, and in what file it found the instructions in.
 
Old 04-11-2010, 05:59 PM   #6
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
Quote:
Originally Posted by Dogs View Post
I guess what I really want to do is watch how the system works. I want to see step-by-step what the PC is doing, what problems it is having, how it is handling those problems, and in what file it found the instructions in.
Not a trivial task.

To see how the pieces fit together you should start by rolling your own using Gentoo or Linux From Scratch.

To see where is configured a given program and how it logs you should be reading the documentation for that given program, since each one is different. As said, most of them will use the system logger, but in a regular desktop system nowadays you can find from many hundreds to many thousands of different packages, each one coming from a different source and author.

The same applies for the place where they take the info from (may it be configuration info, input data or whatever you mean, it's all usually described in the documentation for each program).
 
Old 04-12-2010, 12:45 AM   #7
Dogs
Member
 
Registered: Aug 2009
Location: Houston
Distribution: Slackware 13.37 x64
Posts: 105

Original Poster
Rep: Reputation: 25
I think I'll give LFS a shot. I've spent the last few days on my laptop which I only installed select packages from a, ap, d, e, f, k, and l. It is easier to learn about Linux when there isn't quite so much of it.


The thing that would make me happiest would be to manually create a connection to the internet with a wireless card.
 
Old 04-12-2010, 01:24 AM   #8
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Quote:
Originally Posted by Dogs View Post
The thing that would make me happiest would be to manually create a connection to the internet with a wireless card.
Hi,

Look into
Code:
iwconfig
for that. You can set up wireless connection from the commandline with that command.

Kind regards,

Eric
 
Old 04-12-2010, 02:18 AM   #9
Dogs
Member
 
Registered: Aug 2009
Location: Houston
Distribution: Slackware 13.37 x64
Posts: 105

Original Poster
Rep: Reputation: 25
Quote:
Originally Posted by EricTRA View Post
Hi,

Look into
Code:
iwconfig
for that. You can set up wireless connection from the commandline with that command.

Kind regards,

Eric
How? The commands I've tried with iwconfig haven't had much use.

The only way I've been able to get online is to configure wpa_supplicant.conf, and run the daemon each time I want to connect to the internet. It works fairly well, though. I get online in < 3 seconds so there is no performance loss anyhow.

or

instead of doing iwconfig wlan0 essid xxxxx ap xx:xx:xx:xx:xx

I do

(in a script "wpa")
wpa_supplicant -Dwext -iwlan0 -c/etc/wpa_supplicant.conf

^^this command won't get me an IP address, but will associate with
an access point.


then

dhcpcd wlan0

^^will get an IP address


then I have access to the net. What else could I be doing?

When I try to do that with an iwconfig command I don't get any feedback and nothing ever changes.


ETA- by "Manually create a wireless connection" I mean install and configure all the components that allow the internet to work on my PC. From the kernel drivers to the web browser. I've already done the newbie install on slackware 12.2 and 13 more than a few times, and made an effort to understand what each of those packages was for, and whether or not I needed it, so I don't expect something like LFS to be surprising in any way.


P.S. -> Newbie mode does not take exactly 1 year. It takes exactly 4 and a half hours at a casual pace.

Last edited by Dogs; 04-12-2010 at 02:24 AM.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
KERNEL QUESTION?Please answer it...friends.. radhika789 Linux - General 2 08-08-2009 11:05 AM
Ubuntu Fluxbox simple question, simple answer? generallimptoes Linux - Software 3 09-26-2005 03:03 PM
Installing Programs - A simple question from my simple mind jmp875 Linux - Newbie 6 02-18-2004 10:03 PM
simple question seeking simple answer enzo250gto Linux - Newbie 1 10-27-2001 05:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:29 AM.

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