tags 339030 + patch pending quit On Mon, Nov 14, 2005 at 04:57:12PM +0100, Andras Korn wrote: > I recently started seeing extra newlines between the messages in my system > logs (logged via socklog and svlogd). stracing svlogd I see this (sorry [...]
> As you can see, the line as read from stdin only had one \n at the end; it > was then transmitted via udp to a log server, still with only one \n at the > end; and then, it was logged to a file with an extra \n. > > The config file for the relevant log directory reads: > > --- cut here --- > s500000 > n25 > -* > +*:*:*:* amavis* > +*: amavis* > !/usr/local/sbin/multilogcheck amavis > uIP.OF.LOG.SERVER > --- cut here --- > > If I remove the last line (uIP.OF.LOG.SERVER), the extra newline is no > longer appended. Yes, I can reproduce this, thanks for the good report. Here's a patch that should fix it; I'll include it into the next package upload. Thanks, Gerrit.
Index: src/svlogd.c =================================================================== RCS file: /cvs/runit/src/svlogd.c,v retrieving revision 1.16 diff -u -r1.16 svlogd.c --- src/svlogd.c 11 Jul 2005 11:53:46 -0000 1.16 +++ src/svlogd.c 30 Nov 2005 10:49:09 -0000 @@ -784,9 +784,9 @@ sizeof(dir[i].udpaddr)) != linelen) { buffer_puts(&dir[i].b, "warning: failure sending through udp: "); buffer_put(&dir[i].b, line, linelen); - buffer_put(&dir[i].b, "\n", 1); buffer_flush(&dir[i].b); } + if (line[linelen -1] == '\n') --linelen; } } if (! dir[i].udponly) {