BusyBox Bug and Patch Tracking
BusyBox
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0000627 [BusyBox] New Features feature always 01-06-06 12:45 02-18-08 16:51
Reporter akvadrako View Status public  
Assigned To BusyBox
Priority normal Resolution won't fix  
Status closed   Product Version svn
Summary 0000627: 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.
Additional Information
Attached Files  busybox-logread-dash-n.patch [^] (1,703 bytes) 01-06-06 12:45

- Relationships

- Notes
(0000977)
landley
01-22-06 16:36

What's wrong with logread | tail -n ?
 
(0000978)
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.
 
(0001675)
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.
 
(0005114)
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
02-18-08 16:51 vda Resolution open => won't fix


Copyright © 2000 - 2006 Mantis Group
Powered by Mantis Bugtracker