[syslog-ng] Patch for following non-existent logfiles is affecting syslog-ng.persist

Balazs Scheidler bazsi at balabit.hu
Mon Dec 10 13:19:19 CET 2007


On Fri, 2007-12-07 at 18:11 +0000, Behal, Pavel wrote:
> Dear Bazsi,
> 
> while playing with the latest syslog-ng snapshot from Wed, 5 Dec 2007 10:57:01 +0000
> 
> http://git.balabit.hu/?p=bazsi/syslog-ng-2.0.git;a=snapshot;h=c29352e3a3b61d207106aafae305ba909d454b2a
> 
> , I have received following error during my tests:
> 
> "Internal error, duplicate configuration elements refer to the same persistent config; name='affile_sd_curpos(/aaa/01.txt)"
> 
> for all non-existent log files.
> 
> It is almost harmless, but should not be there. Here is the scenario:
> 
> 1) The file /aaa/01.txt does not exists and is followed in my test configuration (same as I have sent some email before)
> 
> 2) First start of syslog-ng
>          ./syslog-ng -d -v -e -F  -f /usr/local/etc/syslog-ng-tst.conf
> 
> 3) Stopping of syslog-ng by Ctrl+C, everything looks fine, but, even the non-existent log files are written into the  syslog-ng.persist !
> 
> 4) Second start, with same config, parameters and no other changes.
> 
> 5) Second stop, and the error message mentioned above is generated.
> 
> Also the error happens, in case you stop the syslog-ng, and the file previously stored in syslog-ng.persist does not exists anymore.

Thanks for reporting this, I've just pushed an update that fixes this
issue.

> 
> 
> I have also one more wish. Could you please make the syslog-ng.persist file:
> 
> - configurable by command line option or in the config file? Sometimes it is 
> better to move it to some other location, where syslog-ng can write and the 
> recompilation is not comfortable here.  (For example I prefer to run two 
> syslog-ng processes on my system - one for log file reading as non-root and 
> second as root as internal syslog replacement.)

I've added a --persist-file command line option which does this.

> 
> - And could you write persist file more frequently during the syslog-ng run, 
> so the current file positions are not lost in case of machine crash or process 
> hard termination? (I know, this is not the easy part due to possible performance impact.)

This is not very easy, the whole concept of storing things persistently
accross restarts relies on configuration initialization heavily. So this
is impossible in the current design.

> 
> I have also retested the patch "fixed flow-control problem related to source files" 
> and it worked fine. Thank you.

Thanks.

-- 
Bazsi



More information about the syslog-ng mailing list