Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Log rc file output to a file

Status
Not open for further replies.

rtoub

Programmer
Sep 16, 2002
3
US
I seem to remember that the output used to be logged to /var/adm/messages. It has been a while since I have had to work with rc files.

After much research I find that the output is logged to the console and I can sit at the console and watch the messages fly by. I would rather look at them in a log file because my memory is limited to 3 or 4 lines and it appears there are multiple problems. Rebooting over and over is not a good option.

I could re-write all my scripts to output to a file but I would like to see the other messages that the default scripts output as well. Re-writing all the scripts is a daunting and error prone task.

I found that reviewing /var/adm/messages after a reboot conforting to see all the demons and processes starting up.
 

This is useful for a headless system that does not have a A configuration entry in the /etc/syslog.conf file has the following default entry to direct the console messages to a /dev/sysmsg or /var/adm/messages file:

*.err;kern.notice;auth.notice /dev/sysmsg
user.err /dev/sysmsg

In order to redirect the console messages to a file other then the default file, one has to change the following entry in the /etc/syslog.conf file:


eg:
*.err;kern.notice;auth.notice /filename
user.err /filename

...where /filename is an absolute path name for the logfile.
This file should be manually created if it does not exist.

It is recommended that you comment out the original lines to show what you are replacing in case of error. Also, make sure to use tabs as a separator between the fields.
 
I tried this and it doesn't work. There is more information but not what I am looking for.

In my /etc/rc?.d/ directories are lots of startup scripts. They echo status messages and some of the commands return information. I would like to see those messages in a file.
 
If you are talking about the messages that come up on bootup.
you need to run dmesg. Do man page on it.
 
I tried dmesg but it doesn't display the output of the rc S or K scripts either.

I am begining to think it may not be possible.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top