I'm using Linux 2.6 cross compiled for a embedded powerpc.
Earlier we were using busybox syslogd for logging the messages, but as the flexibilty is less, we decided to move to standard syslog.
Now I want to limit the size of the log file (/var/log/messages) to 128K.
I couldn't find any option in syslog.conf file to limit file size of log file, at the same time this option is present in busybox syslog.
Due to flash's size limitation I can't use cron or logrotate.
So, any one please provide a work around to limit the size of /var/log/messages or to make this file a circular one?
Any help is appreciated.
no there's not. you need logrotate which is not a huge application (~40k). if you're so tight on space, you'll probably find that rewriting a bunch of commands in assembly language with only the functionality that you desire and linking to standard C calls will produce much much smaller binaries.
I've done this myself, and things like cat (which is about 10k) I rewrote in 42 bytes with basic error checking. rewrite a bunch of simple commands like that and you'll have room for logrotate (which you may not want to rewrite).