[Bug 191] New: glob-based includes aren't evaluated in proper order
https://bugzilla.balabit.com/show_bug.cgi?id=191 Summary: glob-based includes aren't evaluated in proper order Product: syslog-ng Version: 3.3.x Platform: All OS/Version: All Status: ASSIGNED Severity: normal Priority: unspecified Component: syslog-ng AssignedTo: algernon@balabit.hu ReportedBy: algernon@balabit.hu Type of the Report: bug Estimated Hours: 0.0 While upgrading one of my trickier configs, I noticed that syslog-ng suddenly refused to start, saying it can't find the mongodb destination - this was clearly bogus. A little research revealed the problem: I had a setup where /etc/syslog-ng/syslog-ng.conf had an @include "/etc/syslog-ng/conf.d/" line prior to the upgrade, but when upgraded, that changed to @include "/etc/syslog-ng/conf.d/*.conf". It turns out, that while syslog-ng loads the files in the correct order in both cases, when using globs, the include stack gets botched up: Starting to read include file; filename='/home/algernon/install/sng/3.3/etc/conf.d/00-mongodb.conf', depth='1' Starting to read include file; filename='/home/algernon/install/sng/3.3/etc/conf.d/99-test.conf', depth='2' Error parsing destination, destination plugin mongodb not found in /home/algernon/install/sng/3.3/etc/conf.d/99-test.conf at line 2, column 2: included from /home/algernon/install/sng/3.3/etc/conf.d/00-mongodb.conf line 1, column 1 included from /home/algernon/install/sng/3.3/etc/syslog-ng.conf line 26, column 1 mongodb(); 00-mongodb.conf does NOT include 99-test.conf. syslog-ng.conf includes both with a glob include. But since it thinks 99-test.conf was included by 00-mongodb.conf, it did not evaluate the contents of the latter, and as such, the mongodb module did not get loaded, and then, of course, the 99-test.conf which would use it, will fail with a parse error. With a directory include, this does not happen. A similar issue affects 3.4 too, but there plugin loading happens automatically, so this particular config would work. However, if a later config relies on a former (eg, the former defines a block), then that would break too. -- Configure bugmail: https://bugzilla.balabit.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
https://bugzilla.balabit.com/show_bug.cgi?id=191 Gergely Nagy <algernon@balabit.hu> changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |3.3.7 -- Configure bugmail: https://bugzilla.balabit.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
https://bugzilla.balabit.com/show_bug.cgi?id=191 Gergely Nagy <algernon@balabit.hu> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution| |FIXED Status|ASSIGNED |RESOLVED --- Comment #1 from Gergely Nagy <algernon@balabit.hu> 2012-09-01 12:48:21 --- Turns out, the problem is due to cfg_lexer_include_file_glob_at(), which immediately includes the file, while in the directory-based include case, the file gets added to the current stack level's file list. Changing _glob_at() to do the same fixes the problem. A fix will be pushed to 3.3 master in a few minutes, marking the bug fixed. -- Configure bugmail: https://bugzilla.balabit.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
participants (1)
-
bugzilla@bugzilla.balabit.com