truncated syslog messages
Denis Vlasenko
vda.linux at googlemail.com
Tue Feb 27 22:09:37 UTC 2007
On Wednesday 21 February 2007 15:24, Stephane Billiart wrote:
> The problem:
>
> server# logger "message to syslog"
> server# killall syslogd
> server# tail /var/log/messages
> Feb 21 08:50:19 server syslog.info syslogd started: BusyBox v1.5.0.svn
> Feb 21 08:50:23 server kern.warn kernel: TSC
> Feb 21 08:50:31 server user.notice root: messa
> Feb 21 08:51:25 server syslog.info syslogd exiting
> server# ls -l /dev/log /var/syslog
> lrwxrwxrwx 1 root root 11 Jan 4 1980 /dev/log -> /var/syslog=
> srw-rw-rw- 1 root root 0 Feb 21 08:50 /var/syslog=
>
> All messages syslog receives are truncated, not the ones it writes itself...
>
> My embedded system runs linux 2.6.19.2 with uClibc 0.9.27.
> I have mdev activated in busybox, /dev is a ramfs partition and /var is tmpfs.
> I tried with and without CONFIG_FEATURE_IPC_SYSLOG and get the same results
busybox and uclibc .config? syslogd parameters?
> I see the problem with the SVN and 1.4.1 versions but not with 1.2.2.1
> With glibc 2.3.6, everything is fine also.
glibc 2.4 and uclibc x86_64 svn (patched to fix stdio bug) works ok with
syslogd -m 0 -n -S -s 999 -b 9 -O $PWD/syslog
here
> There's been a lot of changes in syslogd recently.
> I started looking at the code but so far did not find anything to explain
> those short reads from /dev/log.
Adding few printf's is probably the fastest method to narrow it down.
Example:
static void log_locally(char *msg)
{
static time_t last;
struct flock fl;
int len = strlen(msg);
+fprintf(stderr, "log_locally: '%s'\n", msg);
#if ENABLE_FEATURE_IPC_SYSLOG
...
static void timestamp_and_log(int pri, char *msg, int len)
{
char *timestamp;
+fprintf(stderr, "timestamp_and_log: %d '%s'\n", len, msg);
if (len < 16 || msg[3] != ' ' || msg[6] != ' '
|| msg[9] != ':' || msg[12] != ':' || msg[15] != ' '
) {
...
static void split_escape_and_log(char *tmpbuf, int len)
{
char *p = tmpbuf;
+fprintf(stderr, "split_escape_and_log: %d '%s'\n", len, tmpbuf);
tmpbuf += len;
while (p < tmpbuf) {
Then killall syslogd, run new one with -n from the console,
and watch debug output.
--
vda
More information about the busybox
mailing list