Log rotation for sysklogd
I have been using the BusyBox syslogd for a while now. It's nice and small, but sometimes a bit too limited. Due to the resource limitations of my target system I've been dreading having to pull in something else. But recently the lack of standard syslog features, most notably support for more than one remote syslog server and the ability to, e.g., split debug and warning messages to separate log files, have forced me to shop around a bit.
I found sysklogd to be small enough but yet competent. It's the default in most Debian and Ubuntu installations and is a descendant of BSD. So I started playing with it, only to find out (again!) that the BusyBox guys really know what they are doing. The BusyBox syslogd support automatic log rotation, has a a neat circular buffer which a logread tool can hook into and supports double buffering. The one feature I cannot do without is the built-in support for rotating log files. My system is embedded and I don't want to drag in logrotate(8), or cron for that matter, only to rotate a few files. Also, there are several problems with having external scripts do the log rotation.
So, I set about porting the BusyBox log rotation code to sysklogd. Here is the first patch, which will be updated whenever I find bugs, make additions or changes.
When it is done and feels stable enough I'll submit it upstream. If not for general inclusion then perhaps it fits into the contributed patches category.
Sunday, 11 October 2009 at 12:48 | /hacks | permanent link to this entry