On Fri 30/Jan/2015 11:30:25 +0100 Szépe Viktor wrote: 
> Idézem/Quoting Alessandro Vesely <[email protected]>:
> 
>> Every now and then log lines from a filter through stderr to syslog get
>> intermixed.  For example, this came as a single line:
>>
>> Jan 29 13:49:35 wmail courierfilter:  
>> zdkimfilter[31367]:INFO:zdkimfilter[31364]:drop  
>> msg,id=00000000005DC056.0000000054CA2C5F.00007A7D: Found-Virusdrop  
>> msg,id=00000000005DC04E.0000000054CA2C5F.00007A7C: Found-Virus

> Is there a \n at the end of the line written to stderr?

Yes, I have something like so:

   vfprintf(stderr, fmt, ap);
   va_end(ap);
   fputc('\n', stderr);

That "INFO:" arrived from a sibling process.  They both inherit fd 2 as a pipe
to courierfilter.  If courierfilter had seen "INFO:" at the beginning of a line
it would have interpreted it as a severity code.  But, even if stderr is
line-buffered, two processes can happen to flush their buffers simultaneously.

Switching to syslog might/should solve the issue.  It will slightly change log
lines format, so as to possibly require a review of log-parsing scripts, but I
see no canny alternatives.

Ale
-- 




























------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
courier-users mailing list
[email protected]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users

Reply via email to