Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Saving shutting-down kernel messages in a file?

  1. #1

    Default Saving shutting-down kernel messages in a file?

    When shutting down or rebooting openSUSE normally there are some kind of final console logs or messages, from the kernel, I think. Probably describing some of the processes run while halting.

    Those are the ones I'd like to save in a text file, because they'd help me in debugging certain problem I'm having with another rig. How could I do this?

    Thanks beforehand.

  2. #2
    Join Date
    Sep 2012
    Posts
    5,140

    Default Re: Saving shutting-down kernel messages in a file?

    The only way to capture console messages is to configure either serial or net console. You can have multiple "console output devices", all showing the same information.

  3. #3

    Default Re: Saving shutting-down kernel messages in a file?

    It's the first time I've ever heard about that. Already did a fast search and found a tutorial about setting up a serial console, but my rig is a laptop and it doesn't have a 9-pin serial port...

    Can you help me with this task?

  4. #4

    Default Re: Saving shutting-down kernel messages in a file?

    Still help??

  5. #5

    Default Re: Saving shutting-down kernel messages in a file?

    Sorry, no idea about serial debugging...
    But aren't those messages included in /var/log/messages maybe? (depends on which ones you're interested in of course. the ones after unmounting the root filesystem won't be in there for sure... )

    And maybe this could help you:
    Debugging
    There are instructions there on how to write shutdown debug messages from dmesg to a file...

  6. #6
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    26,846
    Blog Entries
    15

    Default Re: Saving shutting-down kernel messages in a file?

    On Sat 01 Jun 2013 04:26:06 AM CDT, F style wrote:


    When shutting down or rebooting openSUSE normally there are some kind of
    final console logs or messages, from the kernel, I think. Probably
    describing some of the processes run while halting.

    Those are the ones I'd like to save in a text file, because they'd help
    me in debugging certain problem I'm having with another rig. How could I
    do this?

    Thanks beforehand.


    Hi
    Have a look at the man page for klogd you can run an instance and log
    the kernel messages to a file.

    --
    Cheers Malcolm °¿° (Linux Counter #276890)
    openSUSE 12.3 (x86_64) Kernel 3.7.10-1.11-desktop
    up 3 days 1:34, 3 users, load average: 0.20, 0.18, 0.21
    CPU AMD Athlon(tm) II P360@2.30GHz | GPU Mobility Radeon HD 4200


  7. #7
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: Saving shutting-down kernel messages in a file?

    On 2013-06-01 17:24, malcolmlewis wrote:

    > Hi
    > Have a look at the man page for klogd you can run an instance and log
    > the kernel messages to a file.


    I'm afraid you can not on shutdown, because the filesystem is umounted
    at some point. What can be done is already in /var/log/messages, to get
    more you need a real serial console (no, usb-rs232 not valid).

    OP: if your laptop has no serial port, get another laptop.
    Or install a virtualized system, and do the testing there. At least
    vmware can save text from the serial port to a log file.

    I have never used 'net console', so I can't help you with that one, sorry.

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 12.1 x86_64 "Asparagus" at Telcontar)

  8. #8
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    26,846
    Blog Entries
    15

    Default Re: Saving shutting-down kernel messages in a file?

    On Sat 01 Jun 2013 03:53:06 PM CDT, Carlos E. R. wrote:

    On 2013-06-01 17:24, malcolmlewis wrote:

    > Hi
    > Have a look at the man page for klogd you can run an instance and log
    > the kernel messages to a file.


    I'm afraid you can not on shutdown, because the filesystem is umounted
    at some point. What can be done is already in /var/log/messages, to get
    more you need a real serial console (no, usb-rs232 not valid).

    OP: if your laptop has no serial port, get another laptop.
    Or install a virtualized system, and do the testing there. At least
    vmware can save text from the serial port to a log file.

    I have never used 'net console', so I can't help you with that one,
    sorry.

    Hi
    It can be done over usb serial, not sure if it's enabled in the kernel
    though?

    The kernel source has a file netconsole.txt which details how it's
    done, doesn't seem to hard to configure.

    --
    Cheers Malcolm °¿° (Linux Counter #276890)
    openSUSE 12.3 (x86_64) Kernel 3.7.10-1.11-desktop
    up 0:10, 3 users, load average: 0.40, 0.20, 0.13
    CPU AMD Athlon(tm) II P360@2.30GHz | GPU Mobility Radeon HD 4200


  9. #9
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: Saving shutting-down kernel messages in a file?

    On 2013-06-01 18:50, malcolmlewis wrote:

    > Hi
    > It can be done over usb serial, not sure if it's enabled in the kernel
    > though?


    That would be a new feature. It is mentioned briefly in the
    "serial-console.txt" file:

    console=device,options

    device: tty0 for the foreground virtual console
    ttyX for any other virtual console
    ttySx for a serial port
    lp0 for the first parallel port
    ttyUSB0 for the first USB serial device

    options: depend on the driver. For the serial port this
    defines the baudrate/parity/bits/flow control of
    the port, in the format BBBBPNF, where BBBB is the
    speed, P is parity (n/o/e), N is number of bits,
    and F is flow control ('r' for RTS). Default is
    9600n8. The maximum baudrate is 115200.

    That's all it says...


    > The kernel source has a file netconsole.txt which details how it's
    > done, doesn't seem to hard to configure.


    Interesting.

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 12.1 x86_64 "Asparagus" at Telcontar)

  10. #10
    Join Date
    Jun 2008
    Posts
    1,825
    Blog Entries
    1

    Default Re: Saving shutting-down kernel messages in a file?

    Here's the info on netconsole.txt; https://www.kernel.org/doc/Documenta...netconsole.txt

    Here's even more kernel documentation; https://www.kernel.org/doc/Documentation/

    Enjoy
    ______________________________________________________________________________________
    Don't ask "if" something can be done, for it can always be done. Rather instead ask "How" can it be done.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •