summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2012-05-29 11:36:13 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2012-05-29 11:36:13 +0200
commit6bc629021eb008e1d48627bdac70b1c8b237937b (patch)
treeba46a74eeb318ea266061bdbcd382f9752453931
parent5fa3c34a1fe0144a2d8cb74cb82a73d8c61d435d (diff)
parentf4ec11fa779e7348f68ece1b3b50d499a0526ace (diff)
downloadrsyslog-6bc629021eb008e1d48627bdac70b1c8b237937b.tar.gz
rsyslog-6bc629021eb008e1d48627bdac70b1c8b237937b.tar.xz
rsyslog-6bc629021eb008e1d48627bdac70b1c8b237937b.zip
Merge branch 'v5-beta' into beta
Conflicts: ChangeLog
-rw-r--r--ChangeLog42
-rw-r--r--plugins/omudpspoof/omudpspoof.c11
-rw-r--r--runtime/debug.c4
-rw-r--r--runtime/debug.h1
-rw-r--r--tools/syslogd.c3
5 files changed, 57 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index c4a27981..2846a59d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,14 @@
---------------------------------------------------------------------------
+Version 6.3.10 [BETA] 2012-0?-??
+- bugfix: if debug message could end up in log file when forking
+ if rsyslog was set to auto-background (thus fork, the default) and debug
+ mode to stdout was enabled, debug messages ended up in the first log file
+ opened. Currently, stdout logging is completely disabled in forking mode
+ (but writing to the debug log file is still possible). This is a change
+ in behaviour, which is under review. If it causes problems to you,
+ please let us know.
+ Thanks to Tomas Heinrich for the patch.
+---------------------------------------------------------------------------
Version 6.3.9 [BETA] 2012-05-22
- bugfix: imtcp could cause hang during reception
this also applied to other users of core file tcpsrv.c, but imtcp was
@@ -442,7 +452,26 @@ expected that interfaces, even new ones, break during the initial
syslog plain tcp input plugin (NOT supporting TLS!)
[ported from v4]
---------------------------------------------------------------------------
-Version 5.9.7 [V5-BETA], 2012-05-??
+Version 5.9.8 [V5-BETA], 2012-05-??
+- bugfix: disk queue was not persisted on shutdown, regression of fix to
+ http://bugzilla.adiscon.com/show_bug.cgi?id=299
+ The new code also handles the case of shutdown of blocking light and
+ full delayable sources somewhat smarter and permits, assuming sufficient
+ timouts, to persist message up to the max queue capacity. Also some nits
+ in debug instrumentation have been fixed.
+---------------------------------------------------------------------------
+Version 5.9.7 [V5-BETA], 2012-05-10
+- added capability to specify substrings for field extraction mode
+- bugfix: ommysql did not properly init/exit the mysql runtime library
+ this could lead to segfaults. Triggering condition: multiple action
+ instances using ommysql. Thanks to Tomas Heinrich for reporting this
+ problem and providing an initial patch (which my solution is based on,
+ I need to add more code to clean the mess up).
+- bugfix: rsyslog did not terminate when delayable inputs were blocked
+ due to unvailable sources. Fixes:
+ http://bugzilla.adiscon.com/show_bug.cgi?id=299
+ Thanks to Marcin M for bringing up this problem and Andre Lorbach
+ for helping to reproduce and fix it.
- bugfix/tcpflood: sending small test files did not work correctly
---------------------------------------------------------------------------
Version 5.9.6 [V5-BETA], 2012-04-12
@@ -587,6 +616,17 @@ Version 5.8.12 [V5-stable] 2012-05-??
full delayable sources somewhat smarter and permits, assuming sufficient
timouts, to persist message up to the max queue capacity. Also some nits
in debug instrumentation have been fixed.
+- bugfix/omudpspoof: problems, including abort, happend when run on
+ multiple threads. Root cause is that libnet is not thread-safe.
+ omudpspoof now guards libnet calls with their own mutex.
+- bugfix: if debug message could end up in log file when forking
+ if rsyslog was set to auto-background (thus fork, the default) and debug
+ mode to stdout was enabled, debug messages ended up in the first log file
+ opened. Currently, stdout logging is completely disabled in forking mode
+ (but writing to the debug log file is still possible). This is a change
+ in behaviour, which is under review. If it causes problems to you,
+ please let us know.
+ Thanks to Tomas Heinrich for the patch.
- bugfix/tcpflood: sending small test files did not work correctly
---------------------------------------------------------------------------
Version 5.8.11 [V5-stable] 2012-05-03
diff --git a/plugins/omudpspoof/omudpspoof.c b/plugins/omudpspoof/omudpspoof.c
index 9a469c16..fadb2c7b 100644
--- a/plugins/omudpspoof/omudpspoof.c
+++ b/plugins/omudpspoof/omudpspoof.c
@@ -132,6 +132,7 @@ ENDinitConfVars
/* add some variables needed for libnet */
libnet_t *libnet_handle;
char errbuf[LIBNET_ERRBUF_SIZE];
+pthread_mutex_t mutLibnet;
/* forward definitions */
static rsRetVal doTryResume(instanceData *pData);
@@ -194,6 +195,8 @@ ENDdbgPrintInstInfo
/* Send a message via UDP
+ * Note: libnet is not thread-safe, so we need to ensure that only one
+ * instance ever is calling libnet code.
* rgehards, 2007-12-20
*/
static inline rsRetVal
@@ -207,6 +210,7 @@ UDPSend(instanceData *pData, uchar *pszSourcename, char *msg, size_t len)
struct sockaddr_in *tempaddr,source_ip;
libnet_ptag_t ip, ipo;
libnet_ptag_t udp;
+ sbool bNeedUnlock = 0;
DEFiRet;
if(pData->pSockArray == NULL) {
@@ -221,6 +225,8 @@ UDPSend(instanceData *pData, uchar *pszSourcename, char *msg, size_t len)
inet_pton(AF_INET, (char*)pszSourcename, &(source_ip.sin_addr));
bSendSuccess = FALSE;
+ d_pthread_mutex_lock(&mutLibnet);
+ bNeedUnlock = 1;
for (r = pData->f_addr; r; r = r->ai_next) {
tempaddr = (struct sockaddr_in *)r->ai_addr;
libnet_clear_packet(libnet_handle);
@@ -280,6 +286,9 @@ UDPSend(instanceData *pData, uchar *pszSourcename, char *msg, size_t len)
}
finalize_it:
+ if(bNeedUnlock) {
+ d_pthread_mutex_unlock(&mutLibnet);
+ }
RETiRet;
}
@@ -453,6 +462,7 @@ BEGINmodExit
CODESTARTmodExit
/* destroy the libnet state needed for forged UDP sources */
libnet_destroy(libnet_handle);
+ pthread_mutex_destroy(&mutLibnet);
/* release what we no longer need */
objRelease(errmsg, CORE_COMPONENT);
objRelease(glbl, CORE_COMPONENT);
@@ -502,6 +512,7 @@ CODEmodInit_QueryRegCFSLineHdlr
errmsg.LogError(0, NO_ERRCODE, "Error initializing libnet, can not continue ");
ABORT_FINALIZE(RS_RET_ERR_LIBNET_INIT);
}
+ pthread_mutex_init(&mutLibnet, NULL);
CHKiRet(regCfSysLineHdlr((uchar *)"actionomudpspoofdefaulttemplate", 0, eCmdHdlrGetWord, NULL, &cs.pszTplName, NULL));
CHKiRet(regCfSysLineHdlr((uchar *)"actionomudpspoofsourcenametemplate", 0, eCmdHdlrGetWord, NULL, &cs.pszSourceNameTemplate, NULL));
diff --git a/runtime/debug.c b/runtime/debug.c
index 955076e2..edc4a255 100644
--- a/runtime/debug.c
+++ b/runtime/debug.c
@@ -68,7 +68,7 @@ static int bPrintAllDebugOnExit = 0;
static int bAbortTrace = 1; /* print a trace after SIGABRT or SIGSEGV */
static char *pszAltDbgFileName = NULL; /* if set, debug output is *also* sent to here */
static int altdbg = -1; /* and the handle for alternate debug output */
-static int stddbg;
+int stddbg = 1; /* the handle for regular debug output, set to stdout if not forking, -1 otherwise */
/* list of files/objects that should be printed */
typedef struct dbgPrintName_s {
@@ -1303,8 +1303,6 @@ dbgGetRuntimeOptions(void)
uchar *optname;
/* set some defaults */
- stddbg = 1;
-
if((pszOpts = (uchar*) getenv("RSYSLOG_DEBUG")) != NULL) {
/* we have options set, so let's process them */
while(dbgGetRTOptNamVal(&pszOpts, &optname, &optval)) {
diff --git a/runtime/debug.h b/runtime/debug.h
index 717c0fef..26672c3e 100644
--- a/runtime/debug.h
+++ b/runtime/debug.h
@@ -35,6 +35,7 @@
/* external static data elements (some time to be replaced) */
extern int Debug; /* debug flag - read-only after startup */
extern int debugging_on; /* read-only, except on sig USR1 */
+extern int stddbg; /* the handle for regular debug output, set to stdout if not forking, -1 otherwise */
/* data types */
diff --git a/tools/syslogd.c b/tools/syslogd.c
index 06fd4cd4..7d995cc2 100644
--- a/tools/syslogd.c
+++ b/tools/syslogd.c
@@ -1671,6 +1671,9 @@ doGlblProcessInit(void)
sigAct.sa_handler = doexit;
sigaction(SIGTERM, &sigAct, NULL);
+ /* stop writing debug messages to stdout (if debugging is on) */
+ stddbg = -1;
+
if (fork()) {
/* Parent process
*/