diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2009-11-20 18:51:25 +0100 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2009-11-20 18:51:25 +0100 |
commit | 4e3589857a2b2667d4b9ad92fe152acb85283aca (patch) | |
tree | 43ccbfb0a52f090ee5b1af589da008d3c333d5ed | |
parent | 7d20954653fa0f8999822554dcb048ee60dbbe58 (diff) | |
parent | 5b55ab75e27861241981ae447ed3d1b8ad968deb (diff) | |
download | rsyslog-4e3589857a2b2667d4b9ad92fe152acb85283aca.tar.gz rsyslog-4e3589857a2b2667d4b9ad92fe152acb85283aca.tar.xz rsyslog-4e3589857a2b2667d4b9ad92fe152acb85283aca.zip |
Merge branch 'v4-devel' into tmp
Conflicts:
ChangeLog
tests/Makefile.am
tests/sndrcv_drvr.sh
tools/syslogd.c
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | runtime/debug.c | 4 | ||||
-rw-r--r-- | runtime/debug.h | 5 | ||||
-rw-r--r-- | tools/syslogd.c | 9 |
4 files changed, 18 insertions, 8 deletions
@@ -277,9 +277,13 @@ Version 4.7.0 [v4-devel] (rgerhards), 2009-09-?? - added new config directive $omfileForceChown to (try to) fix some broken system configs. See ticket for details: http://bugzilla.adiscon.com/show_bug.cgi?id=150 -- imported changes from 4.5.6 and below +- added option to use unlimited-size select() calls + Thanks to varmjofekoj for the patch +- debugondemand mode caused backgrounding to fail - close to a bug, but I'd + consider the ability to background in this mode a new feature... +- imported changes from 4.5.7 and below --------------------------------------------------------------------------- -Version 4.5.7 [v4-beta] (rgerhards), 2009-11-?? +Version 4.5.7 [v4-beta] (rgerhards), 2009-11-18 - added a so-called "On Demand Debug" mode, in which debug output can be generated only after the process has started, but not right from the beginning. This is assumed to be useful for hard-to-find bugs. diff --git a/runtime/debug.c b/runtime/debug.c index 545ac876..a517b1ba 100644 --- a/runtime/debug.c +++ b/runtime/debug.c @@ -1308,11 +1308,11 @@ dbgGetRuntimeOptions(void) /* this is earlier in the process than the -d option, as such it * allows us to spit out debug messages from the very beginning. */ - Debug = 1; + Debug = DEBUG_FULL; debugging_on = 1; } else if(!strcasecmp((char*)optname, "debugondemand")) { /* Enables debugging, but turns off debug output */ - Debug = 1; + Debug = DEBUG_ONDEMAND; debugging_on = 1; dbgprintf("Note: debug on demand turned on via configuraton file, " "use USR1 signal to activate.\n"); diff --git a/runtime/debug.h b/runtime/debug.h index 8d9c1ceb..c011dd2d 100644 --- a/runtime/debug.h +++ b/runtime/debug.h @@ -29,6 +29,11 @@ #include <pthread.h> #include "obj-types.h" +/* some settings for various debug modes */ +#define DEBUG_OFF 0 +#define DEBUG_ONDEMAND 1 +#define DEBUG_FULL 2 + /* 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 */ diff --git a/tools/syslogd.c b/tools/syslogd.c index d510bc41..2470b6fa 100644 --- a/tools/syslogd.c +++ b/tools/syslogd.c @@ -569,7 +569,7 @@ logmsgInternal(int iErr, int pri, uchar *msg, int flags) * permits us to process unmodified config files which otherwise contain a * supressor statement. */ - if(((Debug || NoFork) && bErrMsgToStderr) || iConfigVerify) { + if(((Debug == DEBUG_FULL || NoFork) && bErrMsgToStderr) || iConfigVerify) { if(LOG_PRI(pri) == LOG_ERR) fprintf(stderr, "rsyslogd: %s\n", msg); } @@ -977,9 +977,10 @@ static void doDie(int sig) static int iRetries = 0; /* debug aid */ dbgprintf(MSG1); if(Debug) + if(Debug == DEBUG_FULL) write(1, MSG1, sizeof(MSG1) - 1); if(iRetries++ == 4) { - if(Debug) + if(Debug == DEBUG_FULL) write(1, MSG2, sizeof(MSG2) - 1); abort(); } @@ -2169,7 +2170,7 @@ static rsRetVal mainThread() * is still in its infancy (and not really done), we currently accept this issue. * rgerhards, 2009-06-29 */ - if(!(Debug || NoFork)) { + if(!(Debug == DEBUG_FULL || NoFork)) { close(1); close(2); bErrMsgToStderr = 0; @@ -2361,7 +2362,7 @@ doGlblProcessInit(void) thrdInit(); - if( !(Debug || NoFork) ) + if( !(Debug == DEBUG_FULL || NoFork) ) { DBGPRINTF("Checking pidfile.\n"); if (!check_pid(PidFile)) |