[BusyBox 0000627]: new logread option: -n (like tail)

bugs at busybox.net bugs at busybox.net
Tue Feb 19 00:51:26 UTC 2008


The following issue has been CLOSED 
====================================================================== 
http://busybox.net/bugs/view.php?id=627 
====================================================================== 
Reported By:                akvadrako
Assigned To:                BusyBox
====================================================================== 
Project:                    BusyBox
Issue ID:                   627
Category:                   New Features
Reproducibility:            always
Severity:                   feature
Priority:                   normal
Status:                     closed
Resolution:                 open
Fixed in Version:           
====================================================================== 
Date Submitted:             01-06-2006 12:45 PST
Last Modified:              02-18-2008 16:51 PST
====================================================================== 
Summary:                    new logread option: -n (like tail)
Description: 
This patch adds an option to logread to only display the latest certain #
of lines.  This is very useful since there is no logfile to run tail on
and the entire ring buffer must be copied for tail to work.  On my system
(10MB logfile, 128MB memory) this really isn't practical.

This is tested on i386 with linux 2.6.
====================================================================== 

---------------------------------------------------------------------- 
 landley - 01-22-06 16:36  
---------------------------------------------------------------------- 
What's wrong with logread | tail -n ? 

---------------------------------------------------------------------- 
 akvadrako - 01-22-06 17:13  
---------------------------------------------------------------------- 
Well, I clearly expalin that in my description.  Tail has no way to display
the last lines of a stream because it has no way to know when the stream
will end.  So instead it has to copy the entire input into memory buffer
and then display the last few lines.  This takes too much memory. 

---------------------------------------------------------------------- 
 vda - 09-30-06 14:21  
---------------------------------------------------------------------- 
Is our tail THAT stupid? tail has to remember only last N lines (when it
reads next line, it can forget oldest line in buffer).

The other thing, I really dislike syslogd. Not the code, the concept.
Keeping log in shmem... isn't it silly? shmem in Linux is just a hidden
tmpfs after all, why not use the filesystem explicitly (with log
rotation)? That way no one will need logread AT ALL. 

---------------------------------------------------------------------- 
 vda - 02-18-08 16:51  
---------------------------------------------------------------------- 
"logread | tail -n" should work. Our tail is not eating all input upfront,
it will efficiently read it in small bits.

Alternatively, making syslog dump log into ordinary files (on tmpfs if you
have no writable storage) with log rotation will allow you to use tail on
these files. 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
01-06-06 12:45  akvadrako      New Issue                                    
01-06-06 12:45  akvadrako      Status                   new => assigned     
01-06-06 12:45  akvadrako      Assigned To               => BusyBox         
01-06-06 12:45  akvadrako      File Added: busybox-logread-dash-n.patch         
          
01-22-06 16:36  landley        Note Added: 0000977                          
01-22-06 17:13  akvadrako      Note Added: 0000978                          
09-30-06 14:21  vda            Note Added: 0001675                          
02-18-08 16:51  vda            Status                   assigned => closed  
02-18-08 16:51  vda            Note Added: 0005114                          
======================================================================




More information about the busybox-cvs mailing list