[BusyBox] another one on circular buffer syslogd

Michael Renzmann renzmann at gmx.de
Thu Jan 4 20:43:08 UTC 2001


Hi Gennady.

>         I am sorry for not responding sooner, but I am out of the
> office this week. So I don't get to check/reply my e-mail as I
> usually do. 

No problem. I just wondered if something went wrong with my mailer. In
the office we had lots of problems while changing the mail server (never
change... blabla). Ok, I got a bit paranoid :)

> The multiple processes for syslogd is a known thing and was
> discussed before.

I think it is a bad idea. It may save some bytes for the binary, but
wastes memory (doesn´t it?). 

> There might be a fix for this to get circular buffer working. I can
> remove the code to deallocate the buffer and it should work fine for
> this case. However the buffer will stay allocated and if syslogd is
> restarted it will try to claim it. It actually does that already, so
> if you 'kill -9' syslogd and then start it again it will use the same
> shared memory it used before, but will reset/clear the buffer. I am
> actually unsure what is the best approach for this. 

How about using the first byte of the shared memory as counter. Every
instance/process that uses the shared memory increases the counter on
initialisation and decreases it on de-init. The process that sets the
counter to 0 by decreasing it is the one that should release the memory.

Another thing: I will change syslogd and klogd to create pid files. If
either of the one finds an existing pid it will refuse to continue
starting up. This will prevent multiple processes of syslog/klog running
at the same time. I think this one will be finished at the beginning of
the next week (depending on how much time I'll find tomorrow and on
monday).

Bye, Mike







More information about the busybox mailing list