summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2012-10-29 16:27:53 +0100
committerMichael Biebl <biebl@debian.org>2012-10-29 16:27:53 +0100
commit05bd88b115965e17631a4af10c84d71622fe4e3d (patch)
treec5aaea610fdd889c119a6eecc8cbda571874a9c9
parent30d3515e017ba4b2d74c55c2ad7b897b8a9eb020 (diff)
downloadrsyslog-05bd88b115965e17631a4af10c84d71622fe4e3d.tar.gz
Imported Upstream version 7.2.1upstream/7.2.1
-rw-r--r--ChangeLog21
-rw-r--r--action.c2
-rwxr-xr-xconfigure20
-rw-r--r--configure.ac2
-rw-r--r--doc/manual.html2
-rw-r--r--doc/v6compatibility.html3
-rw-r--r--doc/v7compatibility.html10
-rw-r--r--grammar/grammar.c148
-rw-r--r--grammar/grammar.y2
-rw-r--r--grammar/rainerscript.c2
-rw-r--r--plugins/ommongodb/ommongodb.c31
-rw-r--r--runtime/debug.c6
-rw-r--r--runtime/rsconf.c3
-rw-r--r--runtime/ruleset.c2
-rw-r--r--tests/Makefile.am3
-rw-r--r--tests/Makefile.in3
-rwxr-xr-xtests/rscript_ruleset_call.sh13
-rw-r--r--tests/testsuites/rscript_ruleset_call.conf22
-rw-r--r--tools/rsyslogd.86
-rw-r--r--tools/syslogd.c8
20 files changed, 200 insertions, 109 deletions
diff --git a/ChangeLog b/ChangeLog
index dbabd9b..6e78901 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,15 @@
----------------------------------------------------------------------------
+Version 7.2.1 [v7-stable] 2012-10-29
+- bugfix: ruleset()-object did only support a single statement
+- added -D rsyslogd option to enable config parser debug mode
+- improved syntax error messages by outputting the error token
+- the rsyslog core now suspeneds actions after 10 failures in a row
+ This was former the case after 1,000 failures and could cause rsyslog
+ to be spammed/ressources misused. See the v6 compatibility doc for more
+ details.
+- ommongodb rate-limits error messages to prevent spamming the syslog
+ closes (for v7.2): http://bugzilla.adiscon.com/show_bug.cgi?id=366
+----------------------------------------------------------------------------
Version 7.2.0 [v7-stable] 2012-10-22
This starts a new stable branch based on 7.1.12 plus the following changes:
- bugfix: imuxsock did not properly honor $LocalHostIPIF
@@ -138,7 +149,11 @@ Version 7.1.0 [devel] 2012-09-06
- bugfix: imtcp could abort on exit due to invalid free()
- imported bugfixes from 6.4.1
---------------------------------------------------------------------------
-Version 6.5.1 [devel] 2012-08-??
+Version 6.6.0 [v6-stable] 2012-10-22
+This starts a new stable branch, based on the 6.5.x series, plus:
+- bugfix: imuxsock did not properly honor $LocalHostIPIF
+---------------------------------------------------------------------------
+Version 6.5.1 [beta] 2012-10-11
- added tool "logctl" to handle lumberjack logs in MongoDB
- imfile ported to new v6 config interface
- imfile now supports config parameter for maximum number of submits
@@ -188,7 +203,9 @@ Version 6.5.0 [devel] 2012-08-28
Note: patches were released under ASL 2.0, see
http://bugzilla.adiscon.com/show_bug.cgi?id=353
---------------------------------------------------------------------------
-Version 6.4.3 [V6-STABLE] 2012-??-??
+Version 6.4.3 [V6-STABLE/NEVER RELEASED] 2012-??-??
+This version was never released as 6.6.0 came quickly enough. Note that
+all these patches here are present in 6.6.0.
- cleanup: removed remains of -c option (compatibility mode)
both from code & doc and emitted warning message if still used
closes: http://bugzilla.adiscon.com/show_bug.cgi?id=361
diff --git a/action.c b/action.c
index 9c06f61..ca260f9 100644
--- a/action.c
+++ b/action.c
@@ -659,7 +659,7 @@ actionDoRetry(action_t *pThis, time_t ttNow, int *pbShutdownImmediate)
iRetries = 0;
while((*pbShutdownImmediate == 0) && pThis->eState == ACT_STATE_RTRY) {
iRet = pThis->pMod->tryResume(pThis->pModData);
- if((pThis->iResumeOKinRow > 999) && (pThis->iResumeOKinRow % 1000 == 0)) {
+ if((pThis->iResumeOKinRow > 9) && (pThis->iResumeOKinRow % 10 == 0)) {
bTreatOKasSusp = 1;
pThis->iResumeOKinRow = 0;
} else {
diff --git a/configure b/configure
index 09c8d1f..e12955c 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.67 for rsyslog 7.2.0.
+# Generated by GNU Autoconf 2.67 for rsyslog 7.2.1.
#
# Report bugs to <rsyslog@lists.adiscon.com>.
#
@@ -701,8 +701,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='rsyslog'
PACKAGE_TARNAME='rsyslog'
-PACKAGE_VERSION='7.2.0'
-PACKAGE_STRING='rsyslog 7.2.0'
+PACKAGE_VERSION='7.2.1'
+PACKAGE_STRING='rsyslog 7.2.1'
PACKAGE_BUGREPORT='rsyslog@lists.adiscon.com'
PACKAGE_URL=''
@@ -1682,7 +1682,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures rsyslog 7.2.0 to adapt to many kinds of systems.
+\`configure' configures rsyslog 7.2.1 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1752,7 +1752,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of rsyslog 7.2.0:";;
+ short | recursive ) echo "Configuration of rsyslog 7.2.1:";;
esac
cat <<\_ACEOF
@@ -1972,7 +1972,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-rsyslog configure 7.2.0
+rsyslog configure 7.2.1
generated by GNU Autoconf 2.67
Copyright (C) 2010 Free Software Foundation, Inc.
@@ -2551,7 +2551,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by rsyslog $as_me 7.2.0, which was
+It was created by rsyslog $as_me 7.2.1, which was
generated by GNU Autoconf 2.67. Invocation command line was
$ $0 $@
@@ -3366,7 +3366,7 @@ fi
# Define the identity of the package.
PACKAGE='rsyslog'
- VERSION='7.2.0'
+ VERSION='7.2.1'
cat >>confdefs.h <<_ACEOF
@@ -18804,7 +18804,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by rsyslog $as_me 7.2.0, which was
+This file was extended by rsyslog $as_me 7.2.1, which was
generated by GNU Autoconf 2.67. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -18870,7 +18870,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-rsyslog config.status 7.2.0
+rsyslog config.status 7.2.1
configured by $0, generated by GNU Autoconf 2.67,
with options \\"\$ac_cs_config\\"
diff --git a/configure.ac b/configure.ac
index 5e92e34..331c77b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.61)
-AC_INIT([rsyslog],[7.2.0],[rsyslog@lists.adiscon.com])
+AC_INIT([rsyslog],[7.2.1],[rsyslog@lists.adiscon.com])
AM_INIT_AUTOMAKE
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
diff --git a/doc/manual.html b/doc/manual.html
index e645f2c..185e873 100644
--- a/doc/manual.html
+++ b/doc/manual.html
@@ -19,7 +19,7 @@ rsyslog support</a> available directly from the source!</p>
<p><b>Please visit the <a href="http://www.rsyslog.com/sponsors">rsyslog sponsor's page</a>
to honor the project sponsors or become one yourself!</b> We are very grateful for any help towards the
project goals.</p>
-<p><b>This documentation is for version 7.2.0 (v7-stable branch) of rsyslog.</b>
+<p><b>This documentation is for version 7.2.1 (v7-stable branch) of rsyslog.</b>
Visit the <i><a href="http://www.rsyslog.com/status">rsyslog status page</a></i></b>
to obtain current version information and project status.
</p><p><b>If you like rsyslog, you might
diff --git a/doc/v6compatibility.html b/doc/v6compatibility.html
index edb6ded..7ce8c00 100644
--- a/doc/v6compatibility.html
+++ b/doc/v6compatibility.html
@@ -181,7 +181,7 @@ As you see, here you may include spaces between user names.
so it is a wise decision to change config files at least to the legacy
format (with ":omusrmsg:" in front of the name).
-<h2>Escape Sequences in Script-Based Filters<h2>
+<h2>Escape Sequences in Script-Based Filters</h2>
<p>In v5, escape sequences were very simplistic. Inside a string, "\x" meant
"x" with x being any character. This has been changed so that the usual set of
escapes is supported, must importantly "\n", "\t", "\xhh" (with hh being hex digits)
@@ -189,7 +189,6 @@ and "\ooo" with (o being octal digits). So if one of these sequences was used
previously, results are obviously different. However, that should not create any
real problems, because it is hard to envision why someone should have done that
(why write "\n" when you can also write "n"?).
----------------------------------------------------------------------------
<p>[<a href="manual.html">manual index</a>] [<a href="http://www.rsyslog.com/">rsyslog site</a>]</p>
<p><font size="2">This documentation is part of the
<a href="http://www.rsyslog.com/">rsyslog</a> project.<br>
diff --git a/doc/v7compatibility.html b/doc/v7compatibility.html
index 692a4fe..8834cd5 100644
--- a/doc/v7compatibility.html
+++ b/doc/v7compatibility.html
@@ -42,6 +42,16 @@ They tell that the construct is deprecated and which statement is to be used
as replacement. This does <b>not</b> affect operations: both modules are still
fully operational and will not be removed in the v7 timeframe.
+<h2>Retries of output plugins that do not do proper replies</h2>
+<p>Some output plugins may not be able to detect if their target is capable of
+accepting data again after an error (technically, they always return OK when
+TryResume is called). Previously, the rsyslog core engine suspended such an action
+after 1000 succesive failures. This lead to potentially a large amount of
+errors and error messages. Starting with 7.2.1, this has been reduced to 10
+successive failures. This still gives the plugin a chance to recover. In extreme
+cases, a plugin may now enter suspend mode where it previously did not do so.
+In practice, we do NOT expect that.
+
<p><font size="2">This documentation is part of the
<a href="http://www.rsyslog.com/">rsyslog</a> project.<br>
Copyright &copy; 2011-2012 by <a href="http://www.gerhards.net/rainer">Rainer Gerhards</a> and
diff --git a/grammar/grammar.c b/grammar/grammar.c
index 4a73ff0..c9a7cc6 100644
--- a/grammar/grammar.c
+++ b/grammar/grammar.c
@@ -447,7 +447,7 @@ union yyalloc
/* YYFINAL -- State number of the termination state. */
#define YYFINAL 2
/* YYLAST -- Last index in YYTABLE. */
-#define YYLAST 267
+#define YYLAST 305
/* YYNTOKENS -- Number of terminals. */
#define YYNTOKENS 58
@@ -521,7 +521,7 @@ static const yytype_int8 yyrhs[] =
59, 0, -1, -1, 59, 60, -1, 59, 68, -1,
59, 18, -1, 59, 21, -1, 59, 22, -1, 5,
64, 6, -1, 10, 64, 6, -1, 10, 64, 6,
- 49, 61, 50, -1, 11, 64, 6, 49, 68, 50,
+ 49, 61, 50, -1, 11, 64, 6, 49, 67, 50,
-1, -1, 61, 62, -1, 61, 63, -1, 8, 64,
6, -1, 9, 64, 6, -1, -1, 64, 65, -1,
3, 51, 66, -1, 30, -1, 74, -1, 68, -1,
@@ -649,30 +649,30 @@ static const yytype_int8 yydefgoto[] =
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
STATE-NUM. */
-#define YYPACT_NINF -23
+#define YYPACT_NINF -34
static const yytype_int16 yypact[] =
{
- -23, 222, -23, -23, -23, -23, -23, -23, -22, -17,
- -23, 28, -23, -23, 108, 108, -23, -23, 51, -23,
- -23, -16, -23, 5, 17, 21, 23, -1, 31, -23,
- 25, -23, -23, -23, 1, 51, -23, -23, -23, 51,
- 51, 59, 174, -23, 36, 45, -23, -23, -23, 49,
- 50, 51, -23, 2, -23, 47, -23, -23, 127, -23,
- 40, 108, 51, 51, 51, 51, 51, 51, 51, 51,
+ -34, 266, -34, -34, -34, -34, -34, -34, 11, 17,
+ -34, 22, -34, -34, 129, 129, -34, -34, 51, -34,
+ -34, 6, -34, 5, 20, 21, 32, 7, 25, -34,
+ 143, -34, -34, -34, 31, 51, -34, -34, -34, 51,
+ 51, 48, 218, -34, -1, 34, -34, -34, -34, 3,
+ 37, 51, -34, 76, -34, 0, -34, -34, 171, -34,
+ -10, 129, 51, 51, 51, 51, 51, 51, 51, 51,
51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
- -23, -20, -23, 25, 150, -23, -23, -23, 103, 48,
- -23, 75, -23, 83, 214, 214, 220, 220, 220, 220,
- 220, 220, 220, 220, 220, 220, 46, 46, 46, -23,
- -23, -23, -23, -23, -23, -3, 56, -23, 51, -23,
- -23, 108, -23, -23, -23, -23, -23, -23, -23, -23,
- 81, 82, -23, -23
+ -34, -23, -34, 143, 194, -34, -34, -34, 147, 43,
+ -34, 68, -34, 75, 258, 258, -25, -25, -25, -25,
+ -25, -25, -25, -25, -25, -25, -33, -33, -33, -34,
+ -34, -34, -34, -34, -34, 1, 115, -34, 51, -34,
+ -34, 129, -34, -34, -34, -34, -34, -34, -34, -34,
+ 36, 38, -34, -34
};
/* YYPGOTO[NTERM-NUM]. */
static const yytype_int8 yypgoto[] =
{
- -23, -23, -23, -23, -23, -23, -4, -23, -23, -23,
- 3, -12, -23, 66, -5, -7, 32, -23
+ -34, -34, -34, -34, -34, -34, -4, -34, -34, 18,
+ 4, -12, -34, 58, -3, -15, 24, -34
};
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
@@ -682,64 +682,72 @@ static const yytype_int8 yypgoto[] =
#define YYTABLE_NINF -1
static const yytype_uint8 yytable[] =
{
- 24, 25, 26, 33, 20, 122, 123, 27, 45, 4,
- 112, 46, 28, 42, 7, 8, 9, 10, 11, 12,
- 45, 14, 15, 48, 45, 18, 45, 49, 44, 50,
- 56, 29, 4, 54, 57, 58, 41, 7, 8, 9,
- 10, 11, 12, 4, 14, 15, 84, 124, 18, 93,
- 51, 34, 85, 12, 55, 34, 86, 94, 95, 96,
- 97, 98, 99, 100, 101, 102, 103, 104, 105, 106,
- 107, 108, 109, 110, 111, 35, 36, 37, 38, 35,
- 36, 37, 38, 52, 45, 45, 116, 132, 133, 59,
- 39, 77, 78, 79, 39, 91, 81, 92, 82, 83,
- 40, 87, 119, 41, 40, 120, 127, 41, 121, 129,
- 80, 128, 0, 114, 0, 4, 0, 0, 130, 131,
- 7, 8, 9, 10, 11, 12, 0, 14, 15, 62,
- 63, 18, 0, 0, 0, 64, 65, 66, 67, 68,
- 69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
- 79, 0, 0, 62, 63, 0, 0, 30, 118, 64,
+ 24, 25, 26, 33, 34, 20, 4, 112, 45, 122,
+ 123, 46, 77, 78, 79, 42, 12, 74, 75, 76,
+ 77, 78, 79, 45, 45, 29, 48, 49, 35, 36,
+ 37, 38, 56, 41, 54, 45, 57, 58, 50, 45,
+ 27, 45, 132, 39, 133, 91, 28, 92, 84, 93,
+ 44, 124, 82, 40, 87, 34, 41, 86, 51, 94,
+ 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
+ 105, 106, 107, 108, 109, 110, 111, 52, 59, 35,
+ 36, 37, 38, 4, 55, 81, 83, 54, 7, 8,
+ 9, 10, 11, 12, 39, 14, 15, 119, 120, 18,
+ 121, 116, 80, 128, 40, 114, 0, 41, 0, 129,
+ 0, 0, 0, 0, 0, 0, 0, 0, 130, 131,
+ 86, 0, 4, 0, 0, 0, 85, 7, 8, 9,
+ 10, 11, 12, 0, 14, 15, 4, 0, 18, 0,
+ 0, 7, 8, 9, 10, 11, 12, 0, 14, 15,
+ 4, 0, 18, 0, 0, 7, 8, 9, 10, 11,
+ 12, 0, 14, 15, 0, 127, 18, 0, 0, 0,
+ 0, 0, 0, 62, 63, 0, 0, 0, 30, 64,
65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
- 75, 76, 77, 78, 79, 0, 62, 63, 0, 0,
- 0, 90, 64, 65, 66, 67, 68, 69, 70, 71,
- 72, 73, 74, 75, 76, 77, 78, 79, 61, 0,
- 62, 63, 117, 0, 0, 0, 64, 65, 66, 67,
+ 75, 76, 77, 78, 79, 0, 0, 62, 63, 0,
+ 0, 0, 118, 64, 65, 66, 67, 68, 69, 70,
+ 71, 72, 73, 74, 75, 76, 77, 78, 79, 0,
+ 62, 63, 0, 0, 0, 90, 64, 65, 66, 67,
68, 69, 70, 71, 72, 73, 74, 75, 76, 77,
- 78, 79, 2, 0, 0, 0, 0, 3, 0, 4,
- 0, 0, 5, 6, 7, 8, 9, 10, 11, 12,
- 13, 14, 15, 16, 17, 18, 64, 65, 66, 67,
- 68, 69, 70, 71, 72, 73, 74, 75, 76, 77,
- 78, 79, 74, 75, 76, 77, 78, 79
+ 78, 79, 61, 0, 62, 63, 117, 0, 0, 0,
+ 64, 65, 66, 67, 68, 69, 70, 71, 72, 73,
+ 74, 75, 76, 77, 78, 79, 2, 0, 0, 0,
+ 0, 3, 0, 4, 0, 0, 5, 6, 7, 8,
+ 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
+ 64, 65, 66, 67, 68, 69, 70, 71, 72, 73,
+ 74, 75, 76, 77, 78, 79
};
static const yytype_int8 yycheck[] =
{
- 4, 5, 6, 15, 1, 8, 9, 29, 3, 7,
- 30, 6, 29, 18, 12, 13, 14, 15, 16, 17,
- 3, 19, 20, 6, 3, 23, 3, 6, 44, 6,
- 35, 3, 7, 30, 39, 40, 56, 12, 13, 14,
- 15, 16, 17, 7, 19, 20, 51, 50, 23, 61,
- 51, 4, 50, 17, 53, 4, 53, 62, 63, 64,
- 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
- 75, 76, 77, 78, 79, 28, 29, 30, 31, 28,
- 29, 30, 31, 52, 3, 3, 83, 6, 6, 30,
- 43, 45, 46, 47, 43, 55, 51, 57, 49, 49,
- 53, 54, 54, 56, 53, 30, 50, 56, 25, 121,
- 44, 118, -1, 81, -1, 7, -1, -1, 122, 123,
- 12, 13, 14, 15, 16, 17, -1, 19, 20, 26,
- 27, 23, -1, -1, -1, 32, 33, 34, 35, 36,
- 37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
- 47, -1, -1, 26, 27, -1, -1, 49, 55, 32,
+ 4, 5, 6, 15, 4, 1, 7, 30, 3, 8,
+ 9, 6, 45, 46, 47, 18, 17, 42, 43, 44,
+ 45, 46, 47, 3, 3, 3, 6, 6, 28, 29,
+ 30, 31, 35, 56, 30, 3, 39, 40, 6, 3,
+ 29, 3, 6, 43, 6, 55, 29, 57, 51, 61,
+ 44, 50, 49, 53, 54, 4, 56, 53, 51, 62,
+ 63, 64, 65, 66, 67, 68, 69, 70, 71, 72,
+ 73, 74, 75, 76, 77, 78, 79, 52, 30, 28,
+ 29, 30, 31, 7, 53, 51, 49, 83, 12, 13,
+ 14, 15, 16, 17, 43, 19, 20, 54, 30, 23,
+ 25, 83, 44, 118, 53, 81, -1, 56, -1, 121,
+ -1, -1, -1, -1, -1, -1, -1, -1, 122, 123,
+ 116, -1, 7, -1, -1, -1, 50, 12, 13, 14,
+ 15, 16, 17, -1, 19, 20, 7, -1, 23, -1,
+ -1, 12, 13, 14, 15, 16, 17, -1, 19, 20,
+ 7, -1, 23, -1, -1, 12, 13, 14, 15, 16,
+ 17, -1, 19, 20, -1, 50, 23, -1, -1, -1,
+ -1, -1, -1, 26, 27, -1, -1, -1, 49, 32,
33, 34, 35, 36, 37, 38, 39, 40, 41, 42,
- 43, 44, 45, 46, 47, -1, 26, 27, -1, -1,
- -1, 54, 32, 33, 34, 35, 36, 37, 38, 39,
- 40, 41, 42, 43, 44, 45, 46, 47, 24, -1,
- 26, 27, 52, -1, -1, -1, 32, 33, 34, 35,
- 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
- 46, 47, 0, -1, -1, -1, -1, 5, -1, 7,
- -1, -1, 10, 11, 12, 13, 14, 15, 16, 17,
- 18, 19, 20, 21, 22, 23, 32, 33, 34, 35,
+ 43, 44, 45, 46, 47, -1, -1, 26, 27, -1,
+ -1, -1, 55, 32, 33, 34, 35, 36, 37, 38,
+ 39, 40, 41, 42, 43, 44, 45, 46, 47, -1,
+ 26, 27, -1, -1, -1, 54, 32, 33, 34, 35,
36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
- 46, 47, 42, 43, 44, 45, 46, 47
+ 46, 47, 24, -1, 26, 27, 52, -1, -1, -1,
+ 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
+ 42, 43, 44, 45, 46, 47, 0, -1, -1, -1,
+ -1, 5, -1, 7, -1, -1, 10, 11, 12, 13,
+ 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
+ 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
+ 42, 43, 44, 45, 46, 47
};
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
@@ -757,7 +765,7 @@ static const yytype_uint8 yystos[] =
71, 51, 49, 49, 72, 50, 68, 54, 72, 73,
54, 55, 57, 69, 72, 72, 72, 72, 72, 72,
72, 72, 72, 72, 72, 72, 72, 72, 72, 72,
- 72, 72, 30, 66, 74, 61, 68, 52, 55, 54,
+ 72, 72, 30, 66, 74, 61, 67, 52, 55, 54,
30, 25, 8, 9, 50, 62, 63, 50, 73, 69,
64, 64, 6, 6
};
@@ -2066,7 +2074,7 @@ yyreduce:
/* Line 1455 of yacc.c */
-#line 2070 "grammar.c"
+#line 2078 "grammar.c"
default: break;
}
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
diff --git a/grammar/grammar.y b/grammar/grammar.y
index 343daaa..df673b7 100644
--- a/grammar/grammar.y
+++ b/grammar/grammar.y
@@ -131,7 +131,7 @@ obj: BEGINOBJ nvlst ENDOBJ { $$ = cnfobjNew($1, $2); }
{ $$ = cnfobjNew(CNFOBJ_TPL, $2);
$$->subobjs = $5;
}
- | BEGIN_RULESET nvlst ENDOBJ '{' stmt '}'
+ | BEGIN_RULESET nvlst ENDOBJ '{' script '}'
{ $$ = cnfobjNew(CNFOBJ_RULESET, $2);
$$->script = $5;
}
diff --git a/grammar/rainerscript.c b/grammar/rainerscript.c
index 9483e11..733ebef 100644
--- a/grammar/rainerscript.c
+++ b/grammar/rainerscript.c
@@ -2458,7 +2458,7 @@ cnfstmtOptimizeAct(struct cnfstmt *stmt)
action_t *pAct;
pAct = stmt->d.act;
- if(!strcmp((char*)modGetName(stmt->d.act->pMod), "builtin:omdiscard")) {
+ if(!strcmp((char*)modGetName(pAct->pMod), "builtin:omdiscard")) {
DBGPRINTF("optimizer: replacing omdiscard by STOP\n");
actionDestruct(stmt->d.act);
stmt->nodetype = S_STOP;
diff --git a/plugins/ommongodb/ommongodb.c b/plugins/ommongodb/ommongodb.c
index 2c65f27..0da6dc4 100644
--- a/plugins/ommongodb/ommongodb.c
+++ b/plugins/ommongodb/ommongodb.c
@@ -68,6 +68,7 @@ typedef struct _instanceData {
uchar *pwd;
uchar *dbNcoll;
uchar *tplName;
+ int bErrMsgPermitted; /* only one errmsg permitted per connection */
} instanceData;
@@ -139,19 +140,21 @@ static void
reportMongoError(instanceData *pData)
{
char errStr[1024];
- errmsg.LogError(0, RS_RET_ERR, "ommongodb: error: %s",
- rs_strerror_r(errno, errStr, sizeof(errStr)));
-#if 0
gchar *err;
- if(mongo_sync_cmd_get_last_error(pData->conn, (gchar*)pData->db, &err) == TRUE) {
- errmsg.LogError(0, RS_RET_ERR, "ommongodb: error: %s", err);
- } else {
- errmsg.LogError(0, RS_RET_ERR, "ommongodb: we had an error, but can "
- "not obtain specifics");
+ int eno;
+
+ if(pData->bErrMsgPermitted) {
+ eno = errno;
+ if(mongo_sync_cmd_get_last_error(pData->conn, (gchar*)pData->db, &err) == TRUE) {
+ errmsg.LogError(0, RS_RET_ERR, "ommongodb: error: %s", err);
+ } else {
+ DBGPRINTF("ommongodb: we had an error, but can not obtain specifics, "
+ "using plain old errno error message generator\n");
+ errmsg.LogError(0, RS_RET_ERR, "ommongodb: error: %s",
+ rs_strerror_r(eno, errStr, sizeof(errStr)));
+ }
+ pData->bErrMsgPermitted = 0;
}
-#else
- (void)pData;
-#endif
}
@@ -433,9 +436,11 @@ CODESTARTdoAction
/* FIXME: is this a correct return code? */
ABORT_FINALIZE(RS_RET_ERR);
}
- if(!mongo_sync_cmd_insert(pData->conn, (char*)pData->dbNcoll, doc, NULL)) {
- reportMongoError(pData);
+ if(mongo_sync_cmd_insert(pData->conn, (char*)pData->dbNcoll, doc, NULL)) {
+ pData->bErrMsgPermitted = 1;
+ } else {
dbgprintf("ommongodb: insert error\n");
+ reportMongoError(pData);
ABORT_FINALIZE(RS_RET_SUSPENDED);
}
diff --git a/runtime/debug.c b/runtime/debug.c
index edc4a25..307a8bb 100644
--- a/runtime/debug.c
+++ b/runtime/debug.c
@@ -927,12 +927,12 @@ dbgprint(obj_t *pObj, char *pszMsg, size_t lenMsg)
pszObjName = obj.GetName(pObj);
}
-// pthread_mutex_lock(&mutdbgprint);
-// pthread_cleanup_push(dbgMutexCancelCleanupHdlr, &mutdbgprint);
+ pthread_mutex_lock(&mutdbgprint);
+ pthread_cleanup_push(dbgMutexCancelCleanupHdlr, &mutdbgprint);
do_dbgprint(pszObjName, pszMsg, lenMsg);
-// pthread_cleanup_pop(1);
+ pthread_cleanup_pop(1);
}
#pragma GCC diagnostic warning "-Wempty-body"
diff --git a/runtime/rsconf.c b/runtime/rsconf.c
index ad58883..dcaa1ad 100644
--- a/runtime/rsconf.c
+++ b/runtime/rsconf.c
@@ -67,6 +67,7 @@
#include "dirty.h"
#include "template.h"
+extern char* yytext;
/* static data */
DEFobjStaticHelpers
DEFobjCurrIf(ruleset)
@@ -390,7 +391,7 @@ parser_errmsg(char *fmt, ...)
int
yyerror(char *s)
{
- parser_errmsg("%s", s);
+ parser_errmsg("%s on token '%s'", s, yytext);
return 0;
}
void cnfDoObj(struct cnfobj *o)
diff --git a/runtime/ruleset.c b/runtime/ruleset.c
index bdeb61b..8d2bb92 100644
--- a/runtime/ruleset.c
+++ b/runtime/ruleset.c
@@ -458,14 +458,12 @@ static void
execPROPFILT(struct cnfstmt *stmt, batch_t *pBatch, sbool *active)
{
sbool *thenAct;
- msg_t *pMsg;
sbool bRet;
int i;
thenAct = newActive(pBatch);
for(i = 0 ; i < batchNumMsgs(pBatch) && !*(pBatch->pbShutdownImmediate) ; ++i) {
if(pBatch->pElem[i].state == BATCH_STATE_DISC)
continue; /* will be ignored in any case */
- pMsg = (msg_t*)(pBatch->pElem[i].pUsrp);
if(active == NULL || active[i]) {
bRet = evalPROPFILT(stmt, (msg_t*)(pBatch->pElem[i].pUsrp));
} else
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 715c024..7ccefb0 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -70,6 +70,7 @@ TESTS += \
rscript_stop2.sh \
rscript_prifilt.sh \
rscript_optimizer1.sh \
+ rscript_ruleset_call.sh \
cee_simple.sh \
cee_diskqueue.sh \
linkedlistqueue.sh
@@ -284,6 +285,8 @@ EXTRA_DIST= 1.rstest 2.rstest 3.rstest err1.rstest \
testsuites/rscript_prifilt.conf \
rscript_optimizer1.sh \
testsuites/rscript_optimizer1.conf \
+ rscript_ruleset_call.sh \
+ testsuites/rscript_ruleset_call.conf \
cee_simple.sh \
testsuites/cee_simple.conf \
cee_diskqueue.sh \
diff --git a/tests/Makefile.in b/tests/Makefile.in
index ec789f5..5ce9184 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -542,6 +542,8 @@ EXTRA_DIST = 1.rstest 2.rstest 3.rstest err1.rstest \
testsuites/rscript_prifilt.conf \
rscript_optimizer1.sh \
testsuites/rscript_optimizer1.conf \
+ rscript_ruleset_call.sh \
+ testsuites/rscript_ruleset_call.conf \
cee_simple.sh \
testsuites/cee_simple.conf \
cee_diskqueue.sh \
@@ -1232,6 +1234,7 @@ uninstall-am:
@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ rscript_stop2.sh \
@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ rscript_prifilt.sh \
@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ rscript_optimizer1.sh \
+@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ rscript_ruleset_call.sh \
@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ cee_simple.sh \
@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ cee_diskqueue.sh \
@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ linkedlistqueue.sh
diff --git a/tests/rscript_ruleset_call.sh b/tests/rscript_ruleset_call.sh
new file mode 100755
index 0000000..e29f21d
--- /dev/null
+++ b/tests/rscript_ruleset_call.sh
@@ -0,0 +1,13 @@
+# added 2012-10-29 by rgerhards
+# This file is part of the rsyslog project, released under ASL 2.0
+echo ===============================================================================
+echo \[rscript_ruleset_call.sh\]: testing rainerscript ruleset\(\) and call statement
+source $srcdir/diag.sh init
+source $srcdir/diag.sh startup rscript_ruleset_call.conf
+source $srcdir/diag.sh injectmsg 0 5000
+echo doing shutdown
+source $srcdir/diag.sh shutdown-when-empty
+echo wait on shutdown
+source $srcdir/diag.sh wait-shutdown
+source $srcdir/diag.sh seq-check 0 4999
+source $srcdir/diag.sh exit
diff --git a/tests/testsuites/rscript_ruleset_call.conf b/tests/testsuites/rscript_ruleset_call.conf
new file mode 100644
index 0000000..96eab29
--- /dev/null
+++ b/tests/testsuites/rscript_ruleset_call.conf
@@ -0,0 +1,22 @@
+$IncludeConfig diag-common.conf
+
+template(name="outfmt" type="list") {
+ property(name="msg" field.delimiter="58" field.number="2")
+ constant(value="\n")
+}
+
+
+# we deliberately include continue/stop to make sure we have more than
+# one statement. This catches grammar erorrs
+ruleset(name="rs2") {
+ continue
+ action(type="omfile" file="./rsyslog.out.log" template="outfmt")
+ stop
+}
+
+# this time we make sure a single statement is properly supported
+ruleset(name="rs1") {
+ call rs2
+}
+
+if $msg contains 'msgnum' then call rs1
diff --git a/tools/rsyslogd.8 b/tools/rsyslogd.8
index 86db690..9ded4b9 100644
--- a/tools/rsyslogd.8
+++ b/tools/rsyslogd.8
@@ -10,6 +10,7 @@ rsyslogd \- reliable and extended syslogd
.RB [ " \-6 " ]
.RB [ " \-A " ]
.RB [ " \-d " ]
+.RB [ " \-D " ]
.RB [ " \-f "
.I config file
]
@@ -124,6 +125,11 @@ This option has been obsoleted and has no function any longer. It is still
accepted in order not to break existing scripts. However, future versions
may not support it.
.TP
+.B "\-D"
+Runs the Bison config parser in debug mode. This may help when hard to find
+syntax errors are reported. Please note that the output generated is deeply
+.TP
+technical and orignally targeted towards developers.
.B "\-d"
Turns on debug mode. Using this the daemon will not proceed a
.BR fork (2)
diff --git a/tools/syslogd.c b/tools/syslogd.c
index c580155..05cbfc1 100644
--- a/tools/syslogd.c
+++ b/tools/syslogd.c
@@ -93,6 +93,8 @@
#include <zlib.h>
#endif
+extern int yydebug; /* interface to flex */
+
#include <netdb.h>
#include "pidfile.h"
@@ -1830,7 +1832,7 @@ int realMain(int argc, char **argv)
* of other options, we do this during the inital option processing.
* rgerhards, 2008-04-04
*/
- while((ch = getopt(argc, argv, "46a:Ac:def:g:hi:l:m:M:nN:op:qQr::s:t:T:u:vwx")) != EOF) {
+ while((ch = getopt(argc, argv, "46a:Ac:dDef:g:hi:l:m:M:nN:op:qQr::s:t:T:u:vwx")) != EOF) {
switch((char)ch) {
case '4':
case '6':
@@ -1863,6 +1865,10 @@ int realMain(int argc, char **argv)
case 'd': /* debug - must be handled now, so that debug is active during init! */
debugging_on = 1;
Debug = 1;
+ yydebug = 1;
+ break;
+ case 'D': /* BISON debug */
+ yydebug = 1;
break;
case 'e': /* log every message (no repeat message supression) */
bEOptionWasGiven = 1;