LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Logging entire boot message or slowing the scrolling? (http://www.linuxquestions.org/questions/slackware-14/logging-entire-boot-message-or-slowing-the-scrolling-642050/)

okos 05-14-2008 01:09 AM

Logging entire boot message or slowing the scrolling?
 
Hi as you know, the boot message which I think is both bios messages and linux messages scroll quite quickly.

I know that you can get quite a bit of info from dmesg.

Is there a way to log the entire message in one log or be able to slow the boot message?
Your help would be much appreciated.
Thanks
okos

SqdnGuns 05-14-2008 01:15 AM

Quote:

Originally Posted by okos (Post 3152579)
Hi as you know, the boot message which I think is both bios messages and linux messages scroll quite quickly.

I know that you can get quite a bit of info from dmesg.

Is there a way to log the entire message in one log or be able to slow the boot message?
Your help would be much appreciated.
Thanks
okos

Not sure why anyone would want to slow the boot up process, most want to speed it up.

Read this, I believe you can find your answer here:

http://www.linfo.org/dmesg.html

Very bottom:

Code:

The output of dmesg is maintained in the log file /var/log/dmesg, and it can thus also be easily viewed by reading that file with a text editor, such as vi or gedit, or with a command such as cat, e.g.,

    cat /var/log/dmesg | less


okos 05-14-2008 01:33 AM

Thanks for the info but the dmesg does not print the entire boot message.
That is what Im after.

Im not looking for a slower boot except to scan for specific issues.

SqdnGuns 05-14-2008 01:39 AM

Quote:

Originally Posted by okos (Post 3152602)
Thanks for the info but the dmesg does not print the entire boot message.
That is what Im after.

Im not looking for a slower boot except to scan for specific issues.

dmesg does log the entire boot once the kernel is selected from either lilo or grub.

From the link I previously posted:
Invoking dmesg without any of its options (which are rarely used) causes it to write all the kernel messages to standard output. This usually produces far too many lines to fit into the display screen all at once, and thus only the final messages are visible.
Maybe your not posing the question the way you are thinking it?

Alien Bob 05-14-2008 02:16 AM

Well, dmesg will only log the kernel messages. All the output of the programs and scripts that run during startup are not logged.
What you can do (as long as boot in console mode - runlevel 3) is wait until the command prompt appears, and then use <Shift> <PgUp> to inspect the text that had already scrolled off the console screen.

Eric

SqdnGuns 05-14-2008 02:19 AM

Quote:

Originally Posted by Alien Bob (Post 3152650)
Well, dmesg will only log the kernel messages. All the output of the programs and scripts that run during startup are not logged.
What you can do (as long as boot in console mode - runlevel 3) is wait until the command prompt appears, and then use <Shift> <PgUp> to inspect the text that had already scrolled off the console screen.

Eric

As usual, Bob is right............. :D

Rupa 05-14-2008 05:16 AM

Simply press the Scroll-Lock-Key while booting and everything halts until you press it again. It's as simple as this. :)

harryhaller 05-14-2008 09:15 AM

a serious audit weakness
 
Quote:

Originally Posted by Rupa (Post 3152752)
Simply press the Scroll-Lock-Key while booting and everything halts until you press it again. It's as simple as this. :)

Both Bob and Rupa are correct and just highlight the fundamental problem that if one does not intervene manually either during the boot and initialisation processes or at least before starting any other activity, the complete information on what has occurred from boot during the initiation processes up until the log-in prompt has been lost.

In short: there is a serious audit weakness - no permanent record of what has occurred is made.

All events that occur on the system from boot upto the login prompt should be logged to a file - the question is: how to do this?

Alien Bob 05-14-2008 11:55 AM

Quote:

Originally Posted by harryhaller (Post 3152934)
All events that occur on the system from boot upto the login prompt should be logged to a file - the question is: how to do this?

What you ask for is near impossible. There is a time in the beginning of the boot where there is no medium mounted where the logs can be written to.


Eric

rworkman 05-14-2008 02:05 PM

bootlogd(8) is what you're after, I believe.

okos 05-14-2008 05:25 PM

Hi
First of all thanks for all of the responses.

Quote:

Originally Posted by rworkman (Post 3153218)
bootlogd(8) is what you're after, I believe.

I read the man page. I tried the following command:
Code:

bootlogd -l /var/log/boot
And I got the following error.
Quote:

bootlogd: cannot find console device 136:1 in /dev
According to the man page:
Quote:

Bootlogd runs in the background and copies all strings sent to the /dev/console device to a logfile. If the logfile is not accessible, the messages will be kept in memory until it is.
Im sorry but I am not sure how to get it to work.

There is /dev/console on my slackware system. I guess that is where all of the boot messages are printed at boot.

Adding bootlogd -l /var/log/boot to the beginning of the rc3.d would not help would it?

Thanks for the help.

Stroker 05-14-2008 11:42 PM

.

WARNING: I'm a Linux greenhorn. If you follow my advice you better have your seatbelt fastened, tray locked in the upright position, and barf bag in hand.

Quote:

Originally Posted by okos (Post 3153364)
I read the man page. I tried the following command:
Code:

bootlogd -l /var/log/boot
And I got the following error.

I'm guessing that you tried the command from an xterm. I believe you have to use a real console.


Quote:

Originally Posted by okos (Post 3153364)
Adding bootlogd -l /var/log/boot to the beginning of the rc3.d would not help would it?

rc3.d is a directory. If you mean rc.M, I'd say not. You'd want it logging messages way before that, e.g., rc.S prints a number of useful messages. It defaults to /var/log/boot so you shouldn't need the -l flag. My guess would be to add it at the top of inittab something like this:?

bl::sysinit:/sbin/bootlogd

I'D WAIT FOR SOMEONE THAT ACTUALLY HAS A CLUE TO GIVE A THUMBS-UP OR THUMBS-DOWN ON THAT BEFORE TRYING IT.

rworkman 05-14-2008 11:49 PM

Add that bootlogd line to the top of /etc/rc.d/rc.S (right below the comment block).

Stroker 05-15-2008 12:53 PM

Quote:

Originally Posted by rworkman (Post 3153665)
Add that bootlogd line to the top of /etc/rc.d/rc.S (right below the comment block).

I read that bootlogd is a security risk because it will continue to log all activity on
the boot console including login information.

Perhaps adding it to rc.S this way so it can be activated only when needed by [un]setting it's exe bit?

if [ -x /sbin/bootlogd ]; then
/sbin/bootlogd
fi

Considering that you don't really want bootlogd running after boot completes, it
seems like the correct way would be to have the login prompt kill bootlogd.
I don't know how or where one would do that though.

rworkman 05-15-2008 01:10 PM

Quote:

Originally Posted by Stroker (Post 3154322)
I read that bootlogd is a security risk because it will continue to log all activity on
the boot console including login information.

Perhaps adding it to rc.S this way so it can be activated only when needed by [un]setting it's exe bit?

if [ -x /sbin/bootlogd ]; then
/sbin/bootlogd
fi

Considering that you don't really want bootlogd running after boot completes, it
seems like the correct way would be to have the login prompt kill bootlogd.
I don't know how or where one would do that though.


Interesting; I don't ever recall noticing any login info in the file it creates, but there's a fair chance I didn't look far enough - I was always wanting something from *early* in the boot process.

If that's actually a problem (and perhaps even if it isn't), the best way to handle it would probably be a 'killall bootlogd' as the last line in /etc/rc.d/rc.local

-RW


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