Re: How to wait for kernel messages?

From: Richard B. Johnson
Date: Tue Oct 14 2003 - 07:11:44 EST


On Mon, 13 Oct 2003, Sebastian Piecha wrote:

> I have some problems with one NIC. Due to lack of time as an
> workaround I'd like to wait for the kernel message "NETDEV WATCHDOG:
> eth0: transmit timed out" and ifconfig down/up the NIC.
>
> How can I trigger any action by such a kernel message? Do I have to
> grep the kernel log?
>
> Mit freundlichen Gruessen/Best regards,
> Sebastian Piecha

`cat /proc/kmsg`

...or to wait forever for each message, just open /proc/kmsg and
post a read. Note that kernel logger is also waiting for such
messages so you might not get them all.

Of course the 'Unix-way' is to just do `tail -f /var/log/messages`,
or whatever your log-file name is.


Cheers,
Dick Johnson
Penguin : Linux version 2.4.22 on an i686 machine (797.90 BogoMips).
Note 96.31% of all statistics are fiction.


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