Jose H. wrote:
...
> On 7/4/07, Nick Guenther <[EMAIL PROTECTED]> wrote:
...
>> Why do you need to clear the dmesg?

> I think it is a pretty valid question(request?), you have to relay on
> external mechanisms, like syslog, or to compare differences from previous
> outputs of dmesg.

and the problem with that is...?

> On HP-UX dmesg has the optional parameter '-' which:
>       system tables overflow or the system crashes).  If the - argument is
>       specified, dmesg computes (incrementally) the new messages since the
>       last time it was run and places these on the standard output.  This is
>       typically used with cron (see cron(1)) to produce the error log
>       /var/adm/messages by running the command:
> 
> On FreeBSD and Linux it can be cleared.
> 
> I think it is a feature that can help a lot.

I think not.

Let's not be adding silly knobs for things that can be done better
in other ways:

/home/nick $ dmesg |diff -u /var/run/dmesg.boot -
--- /var/run/dmesg.boot Sun Jun 24 11:17:24 2007
+++ -   Wed Jul  4 22:33:35 2007
@@ -87,3 +87,9 @@
 dkcsum: sd1 matches BIOS drive 0x81
 root on sd0a swap on sd0b dump on sd0b
 WARNING: / was not properly unmounted
+umass0 at uhub0 port 2 configuration 1 interface 0
+umass0: LG USB DRIVE, rev 2.00/2.00, addr 2
+umass0: using SCSI over Bulk-Only
+scsibus2 at umass0: 2 targets
+sd2 at scsibus2 targ 1 lun 0: <LG, USB DRIVE, 2.00> SCSI2 0/direct removable
+sd2: 993MB, 126 cyl, 255 head, 63 sec, 512 bytes/sec, 2034944 sec total

oh, look, someone plugged in a flash disk.

Yes, there are benefits to looking at the change in the dmesg.  I do NOT
like the idea of CLEARING this most valuable resource, however.  Whatever
you wish to accomplish this way can be easily accomplished in some other
way, I think.

Nick.

Reply via email to