All of lore.kernel.org
 help / color / mirror / Atom feed
* logging on kernel panic
@ 2012-06-13 12:18 Mahmood Naderan
  2012-06-13 12:39 ` Alan Cox
  2012-06-13 13:38 ` Cong Wang
  0 siblings, 2 replies; 7+ messages in thread
From: Mahmood Naderan @ 2012-06-13 12:18 UTC (permalink / raw)
  To: linux-kernel

Hi everybody
If a system receives kernel panic during boot, will it be logged somewhere?
In our diskless cluster, clients boot from an image located at /nfsroot
Normally /nfsroot/var/log/syslog should contain messages. However
on a kernel panic, there is no log in /nfsroot/var/log/syslog/


~MN

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: logging on kernel panic
  2012-06-13 12:18 logging on kernel panic Mahmood Naderan
@ 2012-06-13 12:39 ` Alan Cox
  2012-06-13 13:54   ` Jiri Kosina
  2012-06-13 13:38 ` Cong Wang
  1 sibling, 1 reply; 7+ messages in thread
From: Alan Cox @ 2012-06-13 12:39 UTC (permalink / raw)
  To: Mahmood Naderan; +Cc: linux-kernel

On Wed, 13 Jun 2012 05:18:39 -0700 (PDT)
Mahmood Naderan <nt_mahmood@yahoo.com> wrote:

> Hi everybody
> If a system receives kernel panic during boot, will it be logged somewhere?

Often not.. especially if it is fatal. Look up netconsole however.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: logging on kernel panic
  2012-06-13 12:18 logging on kernel panic Mahmood Naderan
  2012-06-13 12:39 ` Alan Cox
@ 2012-06-13 13:38 ` Cong Wang
  1 sibling, 0 replies; 7+ messages in thread
From: Cong Wang @ 2012-06-13 13:38 UTC (permalink / raw)
  To: Mahmood Naderan; +Cc: linux-kernel

On Wed, Jun 13, 2012 at 8:18 PM, Mahmood Naderan <nt_mahmood@yahoo.com> wrote:
> Hi everybody
> If a system receives kernel panic during boot, will it be logged somewhere?
> In our diskless cluster, clients boot from an image located at /nfsroot
> Normally /nfsroot/var/log/syslog should contain messages. However
> on a kernel panic, there is no log in /nfsroot/var/log/syslog/
>

The kernel log may not hit /var/log/syslog when kernel panics,
try other more reliable way to get the kernel log, there are some
new ways to store the kernel log at panic/oops, pstore filesystem
is one of them.

As Alan mentioned, netconsole may work too.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: logging on kernel panic
  2012-06-13 12:39 ` Alan Cox
@ 2012-06-13 13:54   ` Jiri Kosina
  2012-06-13 14:52     ` Mahmood Naderan
  0 siblings, 1 reply; 7+ messages in thread
From: Jiri Kosina @ 2012-06-13 13:54 UTC (permalink / raw)
  To: Alan Cox; +Cc: Mahmood Naderan, linux-kernel

On Wed, 13 Jun 2012, Alan Cox wrote:

> > Hi everybody
> > If a system receives kernel panic during boot, will it be logged somewhere?
> 
> Often not.. especially if it is fatal. Look up netconsole however.

Well your machine's BIOS can still be providing non-volatile sotrage which 
under recent kernels registers itself with 'pstore', and you can get the 
dmesg+panic from there then (provided you have all the necessary bits, 
such as APEI, compiled in and enabled).

-- 
Jiri Kosina
SUSE Labs


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: logging on kernel panic
  2012-06-13 13:54   ` Jiri Kosina
@ 2012-06-13 14:52     ` Mahmood Naderan
  2012-06-13 15:15       ` Mark Lord
  2012-06-14  8:02       ` Jiri Kosina
  0 siblings, 2 replies; 7+ messages in thread
From: Mahmood Naderan @ 2012-06-13 14:52 UTC (permalink / raw)
  To: Jiri Kosina; +Cc: Alan Cox, "linux-kernel@vger.kernel.org", Cong Wang

@jiri:
>and you can get the dmesg+panic from there
 Sorry where? in the bios?

@Cong:
>The kernel log may not hit /var/log/syslog when kernel panics,
Can I ask why. Just before a panic, kernel is still alive and can log. 
Isn't that?


// Naderan *Mahmood;


----- Original Message -----
From: Jiri Kosina <jkosina@suse.cz>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Mahmood Naderan <nt_mahmood@yahoo.com>; "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Sent: Wednesday, June 13, 2012 6:24 PM
Subject: Re: logging on kernel panic

On Wed, 13 Jun 2012, Alan Cox wrote:

> > Hi everybody
> > If a system receives kernel panic during boot, will it be logged somewhere?
> 
> Often not.. especially if it is fatal. Look up netconsole however.

Well your machine's BIOS can still be providing non-volatile sotrage which 
under recent kernels registers itself with 'pstore', and you can get the 
dmesg+panic from there then (provided you have all the necessary bits, 
such as APEI, compiled in and enabled).

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: logging on kernel panic
  2012-06-13 14:52     ` Mahmood Naderan
@ 2012-06-13 15:15       ` Mark Lord
  2012-06-14  8:02       ` Jiri Kosina
  1 sibling, 0 replies; 7+ messages in thread
From: Mark Lord @ 2012-06-13 15:15 UTC (permalink / raw)
  To: Mahmood Naderan; +Cc: Jiri Kosina, Alan Cox, linux-kernel, Cong Wang

On 12-06-13 10:52 AM, Mahmood Naderan wrote:
>
>> The kernel log may not hit /var/log/syslog when kernel panics,
> Can I ask why. Just before a panic, kernel is still alive and can log. 
> Isn't that?

The kernel writes log messages to a circular in-RAM fifo (/proc/kmsg).
They then later get saved to a file such as /var/log/syslog by some
userspace task, eg. rsyslogd or syslogd.

At the point a Kernel Panic, the kernel is considered "dead",
or "non trustworthy" due to the error condition that triggered the panic.
Attempting to continue after the panic would be unwise,
with the possibilities including opening huge security holes/leaks
and/or corrupting user data.

So it is no longer alive, and will not be scheduling the userspace tasks
that might copy the log to a file for you.  Thus, nothing gets saved.




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: logging on kernel panic
  2012-06-13 14:52     ` Mahmood Naderan
  2012-06-13 15:15       ` Mark Lord
@ 2012-06-14  8:02       ` Jiri Kosina
  1 sibling, 0 replies; 7+ messages in thread
From: Jiri Kosina @ 2012-06-14  8:02 UTC (permalink / raw)
  To: Mahmood Naderan
  Cc: Alan Cox, "linux-kernel@vger.kernel.org", Cong Wang

On Wed, 13 Jun 2012, Mahmood Naderan wrote:

> >and you can get the dmesg+panic from there
>  Sorry where? in the bios?

Read Documentation/ABI/testing/pstore in the kernel sources.

> @Cong:
> >The kernel log may not hit /var/log/syslog when kernel panics,
> Can I ask why. Just before a panic, kernel is still alive and can log. 

At the point of panic, the machine is too dead to be able to perform such 
a complex operation as writing to filesystem.

-- 
Jiri Kosina
SUSE Labs

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-06-14  8:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-13 12:18 logging on kernel panic Mahmood Naderan
2012-06-13 12:39 ` Alan Cox
2012-06-13 13:54   ` Jiri Kosina
2012-06-13 14:52     ` Mahmood Naderan
2012-06-13 15:15       ` Mark Lord
2012-06-14  8:02       ` Jiri Kosina
2012-06-13 13:38 ` Cong Wang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.