[BusyBox] syslogd circular buffer
Joerg Schmitz-Linneweber
schmitz-linneweber at aston-technologie.de
Mon May 6 09:29:03 UTC 2002
Hi!
On Monday, 6. May 2002 10:49, Michael Sternberg wrote:
> ...
> How big is circular buffer syslogd uses ?
a "grep -i data_size projekte/iport/buildroot/busybox/syslogd.c"
leads to:
--- snip -------
int size; // size of data written
int data_size = 16000; // data size
int shm_size = 16000 + sizeof(*buf); // our buffer size
if ((shmid = shmget(KEY_ID, shm_size, IPC_CREAT | 1023)) == -1)
buf->size=data_size;
* Start-off w/ empty buffer of specific size SHM_SIZ
if ( (buf->tail + l) < buf->size ){
char *c=memchr(buf->data+buf->head +
k,'\0',buf->size - (buf->head + k));
--- snap -------
So I would think ~16k :-)
> What happens on shutdown ? Can I use some switch
> telling syslogd to write this buffer to disk in case of TERM signal ?
Add a signal handler for SIGTERM then. Or add an entry to your inittab which
then needs to do IPC (like the logread prog.) with your syslogd. In the last
case remember that entries with the same runlevel are ececuted in the
*opposite* order as they apear in the file! (If I rember correctly)
> And if we're talking about TERM signal - how can I increase
> interval between TERM and KILL signals that halt issues to every process ?
> Besides changing the sources ? :)
Have a look at the impl. of init.c! But I assume you _will_ have to change
the source ;-) Or again add a "sleep 10" to your inittab...
Salut, Jörg
--
Joerg Schmitz-Linneweber
gpg/pgp key id: 0x146428F1
ASTON GmbH, Ruhrorter Straße 9, 46049 Oberhausen, Germany
Tel. +49 (208) 6201930, FAX +49 (208) 6201950, http://www.aston-technologie.de
More information about the busybox
mailing list