You are not logged in.

#1 2009-01-16 01:28:53

virati
Member
Registered: 2008-04-14
Posts: 83

Logfile from Startup

I'm trying to find the log file that contains exactly what I SEE while arch is booting up. there's a specific message that disappears a little too fast for me to catch that I want to read. Which one of the log files is the closest one (everything.log is just too much... and I don't even think it has what I need). Thanks.

Offline

#2 2009-01-16 02:14:51

kludge
Member
Registered: 2008-08-03
Posts: 294

Re: Logfile from Startup

dmesg | less

it should start at the very beginning of the last boot, right after the hand-off from the initcpio.


[23:00:16]    dr_kludge | i want to invent an olfactory human-computer interface, integrate it into the web standards, then produce my own forked browser.
[23:00:32]    dr_kludge | can you guess what i'd call it?
[23:01:16]    dr_kludge | nosilla.
[23:01:32]    dr_kludge | i really should be going to bed.  i'm giggling madly about that.

Offline

#3 2009-01-16 02:18:49

arch_nemesis
Member
Registered: 2008-12-19
Posts: 115

Re: Logfile from Startup

This is one of those fundamental questions I've had but never got around to asking, so I'm looking forward to the answer (edit: which wasn't there when I started this post lol).

However, if you know even one of the words in the line you are looking for, and you are not entirely sure that everything.log doesn't have it, you can do this:

cat /var/log/everything.log | grep whateverkeywordyouwant -- and you'll only see the lines with that word.

(Apologies if this is old hat to you -- I just learned about piping things to grep a few months ago, and it's my favorite thing now.  wink)

Last edited by arch_nemesis (2009-01-16 02:19:38)

Offline

#4 2009-01-16 02:20:56

rson451
Member
From: Annapolis, MD USA
Registered: 2007-04-15
Posts: 1,233
Website

Re: Logfile from Startup

If you want to see boot messages, you can add "read KEY" to the end of your /etc/rc.local and boot will pause at that point until you press a key.  I don't know that every single thing at boot is logged.


archlinux - please read this and this — twice — then ask questions.
--
http://rsontech.net | http://github.com/rson

Offline

#5 2009-01-16 02:25:18

virati
Member
Registered: 2008-04-14
Posts: 83

Re: Logfile from Startup

rson451 wrote:

If you want to see boot messages, you can add "read KEY" to the end of your /etc/rc.local and boot will pause at that point until you press a key.  I don't know that every single thing at boot is logged.

Wait... what exactly do you mean by 'read KEY'. Will it stop when it reaches 'KEY' text? Or does that entire statement make it stop at any error messages/oddities? If it's the latter then that's awesome and exactly what I want but that seems a little too convenient and i'm probably just misunderstanding.

As for grep -> yeah, it is definately the most useful thing I can think of at the moment. unfortunately, I don't know exactly what it says. All i remember is 'audio' and 'usb' which won't help me whatsoever.

Thanks for the responses. I think I found my answer.

Offline

#6 2009-01-16 02:30:02

kludge
Member
Registered: 2008-08-03
Posts: 294

Re: Logfile from Startup

arch_nemesis wrote:

cat /var/log/everything.log | grep whateverkeywordyouwant -- and you'll only see the lines with that word.

(Apologies if this is old hat to you -- I just learned about piping things to grep a few months ago, and it's my favorite thing now.  wink)

+5

i maintain that you will *never* be effective at the command-line if you don't grok pipes and grep.  the bash man file is ridiculously long and frequently difficult to make useful, but google knows where to find a plethora of invaluable guides.

@rson: don't know why i never thought of that, especially for watching the initcpio at work, since it's init doesn't leave a log anywhere after the hand-off to kinit.


[23:00:16]    dr_kludge | i want to invent an olfactory human-computer interface, integrate it into the web standards, then produce my own forked browser.
[23:00:32]    dr_kludge | can you guess what i'd call it?
[23:01:16]    dr_kludge | nosilla.
[23:01:32]    dr_kludge | i really should be going to bed.  i'm giggling madly about that.

Offline

#7 2009-01-16 02:34:30

rson451
Member
From: Annapolis, MD USA
Registered: 2007-04-15
Posts: 1,233
Website

Re: Logfile from Startup

virati wrote:
rson451 wrote:

If you want to see boot messages, you can add "read KEY" to the end of your /etc/rc.local and boot will pause at that point until you press a key.  I don't know that every single thing at boot is logged.

Wait... what exactly do you mean by 'read KEY'. Will it stop when it reaches 'KEY' text? Or does that entire statement make it stop at any error messages/oddities? If it's the latter then that's awesome and exactly what I want but that seems a little too convenient and i'm probably just misunderstanding.

As for grep -> yeah, it is definately the most useful thing I can think of at the moment. unfortunately, I don't know exactly what it says. All i remember is 'audio' and 'usb' which won't help me whatsoever.

Thanks for the responses. I think I found my answer.

It stops all processing and waits for a keyboard input.  Any key press will continue the boot.


archlinux - please read this and this — twice — then ask questions.
--
http://rsontech.net | http://github.com/rson

Offline

#8 2009-01-16 02:41:33

kludge
Member
Registered: 2008-08-03
Posts: 294

Re: Logfile from Startup

virati wrote:

Wait... what exactly do you mean by 'read KEY'. Will it stop when it reaches 'KEY' text? Or does that entire statement make it stop at any error messages/oddities? If it's the latter then that's awesome and exactly what I want but that seems a little too convenient and i'm probably just misunderstanding.

arch-style answer:

'man read'

but because this is the 'newbie corner':

'read' reads from standard input until it receives an end-of-line character and sets what it receives as the value of a variable named as its first parameter.  in rson's example, it will sit there until you hit <enter>.  this will give you the opportunity to browse backwards through your logs.  use <shift>+<pg_up> to go backwards, but be warned, if you're in a shell, you can only browse back as far as your shell's history remembers.

'less' is a "pager," which means it divides its input into pages of a given length and then displays them one at a time.  it does more than that, and it's not the only pager out there, but that's what man pages are for wink

@rson451: dammit, we're in a race condition, and you're winning because i'm permanently invoked with a verbose flag!

Last edited by kludge (2009-01-16 02:43:42)


[23:00:16]    dr_kludge | i want to invent an olfactory human-computer interface, integrate it into the web standards, then produce my own forked browser.
[23:00:32]    dr_kludge | can you guess what i'd call it?
[23:01:16]    dr_kludge | nosilla.
[23:01:32]    dr_kludge | i really should be going to bed.  i'm giggling madly about that.

Offline

#9 2009-01-16 03:13:20

rson451
Member
From: Annapolis, MD USA
Registered: 2007-04-15
Posts: 1,233
Website

Re: Logfile from Startup

kludge wrote:

@rson451: dammit, we're in a race condition, and you're winning because i'm permanently invoked with a verbose flag!

You'd like this thread then: http://bbs.archlinux.org/viewtopic.php?id=63078


archlinux - please read this and this — twice — then ask questions.
--
http://rsontech.net | http://github.com/rson

Offline

#10 2009-01-16 03:22:10

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,390
Website

Re: Logfile from Startup

arch_nemesis wrote:

cat /var/log/everything.log | grep whateverkeywordyouwant -- and you'll only see the lines with that word.

(Apologies if this is old hat to you -- I just learned about piping things to grep a few months ago, and it's my favorite thing now.  wink)

Well, the better way is:

grep "foo" /var/log/everything.log

Not need for cat.

Offline

#11 2009-01-16 03:54:57

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: Logfile from Startup

I'm tempted to post a +1 to Allan's statement but i won't do that.

Cat is a basic command and way too popular - so popular that it's abused a lot. Grep has lots of fancy options (ignoring upper/lowercase, showing x lines before or after the match, filtering everything but the argument, using regular expressions) that make it a far more versatile tool than just the basic 'cat'. If you need some stuff piped to a command that can't read stuff from stdin, or want to read a file in its entirety, cat is fine. Otherwise, leave it out, it's redundant. As often on Linux, less is more tongue.

Also - look into its brother egrep if you need to filter for multiple arguments wink. Enjoy tongue.


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#12 2009-01-16 04:34:21

arch_nemesis
Member
Registered: 2008-12-19
Posts: 115

Re: Logfile from Startup

^^Thanks for the tips, guys!

Offline

Board footer

Powered by FluxBB