13

My Linux boot fails often. I have removed quiet from my boot options so I can see what's going on. Basically after showing a bunch of [pass] messages, it hangs. It does not hang every time. Now I know dmesg is the way I can see boot messages.

But I want to look at the boot messages of the previous boot and not the current boot (because this one booted normally, while last one hanged).

Also are there any other logs I can look at to find the problem? I am using Ubuntu Natty 11.04. Should I recompile my kernel with debugging support? Is that the only way to debug this issue?

Finally, is this what is called a kernel panic (soft / hard or something)?

Jeff Schaller
  • 67,283
  • 35
  • 116
  • 255
AnkurVj
  • 1,003

1 Answers1

13

/var/log/messages (or /var/log/syslog on some systems) is the main system log file - look there. Depending on configuration options, it can contain same, more or less information than dmesg shows. Also, it is continuous by default (appended, not replaced at each boot).

Whether or not you'll need to recompile your kernel to solve the problem depends on what you can already find there and in other app-specific logs.

Kernel panic is a symptom of a serious system problem. So serious that the kernel is not equipped with means to go about it. This can be triggered by many various issues of various kinds: including driver bugs, severe hardware failures, bugs in base system programs, rarely userspace applications.

  • In my installation the file was called syslog and not messages in the folder /var/log. I have found the message : could not open output file /dev/xconsole before every hang of the kernel. – AnkurVj Oct 03 '11 at 15:36
  • Ok, thanks for telling about syslog alternative name. Added to the answer for reference. I hope you managed to solve the problem. – rozcietrzewiacz Oct 04 '11 at 06:13
  • /var/log/syslog and /var/log/messages are not the same file, and one should not under normal circumstances exist without the other. They're both generated by the syslog daemon(like rsyslog). Usually syslog will contain most if not all messages, whereas messages will be more filtered. See your syslog config (probably /etc/rsyslog.conf) for more details. – gamen Oct 04 '11 at 10:18
  • 1
    @gamen Not exactly. This depends on the program that handles system messages (logger daemon). Your description and the files you refer to indicate that your system uses rsyslog. Another popular one is syslog-ng. But in each case, the exact file names and their roles depend on the configuration. So there are no general "normal circumstances" and /var/log/messages can be, and often is, the main system log. – rozcietrzewiacz Oct 04 '11 at 13:22
  • @roz yes, by finding the message before system crashed in syslog and searching for a solution on google, I managed to solve the problem – AnkurVj Oct 04 '11 at 19:38
  • @rozcietrzewiacz Thanks for being more specific. It would be interesting if you could give examples of default configurations which do not generate both files regardless of the syslog daemon running. I can only think of non-linux systems exhibiting this behavior out of the box (FreeBSD for example), but if you have any (particularly linux distributions and/or system logger default configurations), I'd love to know! – gamen Oct 05 '11 at 10:03
  • @gamen I'm afraid don't understand what you mean by default configurations which do not generate both files regardless of the syslog daemon running. I'm using syslog-ng on gentoo and it uses /var/log/messages only by default. If you'd like to know what systems use similar default configuration, you can download the source package and have a look at various syslog-ng.conf files prepared to be shipped for particular systems. – rozcietrzewiacz Oct 05 '11 at 11:03
  • @gamen ...My quick search in the said sources revealed (to name only linuxes) Fedora, Red Hat and Debian to use /var/log/messages and not /var/log/syslog. Other than this, I can see that the minimal syslogd built into busybox uses /var/log/messages by default as well. Another interesting way to research this topic is to google for "Linux log files". – rozcietrzewiacz Oct 05 '11 at 11:26