Re: retaining messages from previous boot - /var/log/messages OR /var/log/boot.log

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The Situation is this :

I have compiled Xen Hypervisor , and it just hangs at some point
during the boot. I want to send to a relevant Xen mailing list the sequence
of events before the hang.

When the System hangs , I just restart the system uncleanly ( press the power button for 30 sec)
and reboot the machine with the working kernel. Now, I want to see in /var/log/messages the
sequence of events that occured  before the hang in the previous boot. I am not able to
see those log messages , they are overwritten during every boot.

I want to maintain these logs to send to the mailing list.

Thanks for your concern,
Onkar
 

On Sat, May 15, 2010 at 4:33 PM, arshad hussain <arshad.super@xxxxxxxxx> wrote:
On Sat, May 15, 2010 at 3:04 PM, Onkar Mahajan <kern.devel@xxxxxxxxx> wrote:
> But some linux distributions do keep the previous boot logs , this will help
> me to know
> where the kernel Paniced ??
>
> Regards,
> Onkar
>
> On Sat, May 15, 2010 at 2:33 PM, arshad hussain <arshad.super@xxxxxxxxx>
> wrote:
>>
>> On Sat, May 15, 2010 at 9:50 AM, Onkar Mahajan <kern.devel@xxxxxxxxx>
>> wrote:
>> > I want to retain the messages from all the previous boots in the
>> > /var/log/messages
>> > How do I append the messages in /var/log/messages rather than create a
>> > new
>> > file
>> > each time during the boot ?
>> >
>> > Regards,
>> > Onkar
>> >
>> >
>>
>> One way to do it would be. Copy /var/log/message to any file at every
>> shutdown. And use logger command to insert contents of this new file
>> at every startup. This would boil down to ...
>>
>> /* Inside Your shutdown script ( rc6.d ) */
>> $ cat /var/log/message > /tmp/my_logfile
>>
>> /* Inside Your startup script */
>> $ logger -f /tmp/my_logfile
>>
>> Be advised, /var/log/message will not grow indefinitely, after reaching
>> some
>> size it will start "chopping" out the top. Have a look at man pages of
>> logger
>> and syslog.
>>
>> Thanks
>
>

Oh!, I thought your question was "How to append message in /var/log/messages".
I am afraid, It is not clear to me what exactly you are saying.
Guessing, it seems like once
you get a panic, inevitably your kernel reboots and you need some way to find
to find out where. And you want to log it into /var/log/message. If I
got this correct then you have to look at the 'crash' command.

Thanks


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux