LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-04-2012, 08:59 AM   #1
jake_the_dog
LQ Newbie
 
Registered: Jun 2012
Posts: 5

Rep: Reputation: Disabled
Driver startup script not recording output in /var/log/messages.


Hello,

I have modified a start-up script to validate some parameters before loading a driver. However, the output, ( whether or not the parameters are correct ) is not being recorded in /var/log/messages, or anywhere else for that matter. I have tried both echo and logger statements but neither work. The output in the script, for example:

echo "Valid parameters, driver loaded."

IS written to the console during boot-up, but is lost after this. Does anyone understand why the output is not being written anywhere. All output should be written to /var/log/messages but it is not there.
 
Old 06-04-2012, 09:11 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Startup scripts by their nature run when not everything else is running. Did you set the startup script to run AFTER the one that starts syslogd?

Also your echo isn't redirecting output anywhere which is why it appears on the console which is the standard output device for startup scripts usually.

You could try changing:
echo "Valid parameters, driver loaded."

to:
echo "Valid parameters, driver loaded." |tee -a /var/log/messages

That would make it show the output on the console AND append it to the /var/log/messages file. (You might have to input full path to tee command for the startup script to find it.)

Also be careful what you put in startup scripts. If you put something there that hangs/never completes it could hang your entire startup at that point.
 
Old 06-04-2012, 09:20 AM   #3
jake_the_dog
LQ Newbie
 
Registered: Jun 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
Yes I have already tried redirecting the output to a file. I have been told that all of the output printed to the console ( by start-up scripts ) will be recorded in /var/log/messages. I do see my output being printed to the console when I reboot the machine, but I cannot find it logged anywhere in a file once I am on the machine.

echo "Valid parameters, driver loaded." |tee -a /var/log/messages

is equivalent to the 'logger' command, which I have already tried.
 
Old 06-04-2012, 09:55 AM   #4
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Somebody has misinformed you. Linux startup scripts are NOT automatically logged to syslog. As I noted before syslog itself is started by one of the startup scripts.

Unfortunately I don't know of any facility in Linux that will log startup scripts automatically. (I got spoiled by HP-UX which logs everything to /etc/rc.log from startup scripts.) "dmesg" will show you many things that happened during startup (and errors after that) but doesn't show everything.

P.S. Since you didn't show a redirect in your echo there was no way for me to know you were doing it.
 
Old 06-04-2012, 10:36 AM   #5
jake_the_dog
LQ Newbie
 
Registered: Jun 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
Do you have any intuition on why the output is not being logged even after the output has been redirected?
 
Old 06-05-2012, 08:39 AM   #6
jake_the_dog
LQ Newbie
 
Registered: Jun 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
I believe that my start-up scripts are executing before the kernel logger has loaded. Is there anyway to get any meaningful data out of the scripts some other way?
 
Old 06-05-2012, 10:29 AM   #7
jake_the_dog
LQ Newbie
 
Registered: Jun 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
Closing thread, this was indeed the problem.
 
  


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
Understanding /var/log/messages memory output kenneho Linux - Software 7 03-10-2008 10:09 AM
flaky adsl, can you explain this /var/log/messages output? pbhj Linux - Networking 2 02-01-2008 07:04 PM
Bash script for server log (namely var/log/messages) tenaciousbob Programming 17 05-24-2007 10:43 AM
No output to /var/log/messages or ~syslog eelriver Slackware 5 07-18-2004 05:13 AM
output of printk can NOT be found in /var/log/messages linshu Linux - Software 1 02-13-2004 09:06 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:17 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