summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/immark/immark.c46
-rw-r--r--plugins/ommysql/ommysql.c2
-rw-r--r--plugins/ompgsql/ompgsql.c2
3 files changed, 44 insertions, 6 deletions
diff --git a/plugins/immark/immark.c b/plugins/immark/immark.c
index 0236a38c..d70069c5 100644
--- a/plugins/immark/immark.c
+++ b/plugins/immark/immark.c
@@ -1,4 +1,4 @@
-/* omfwd.c
+/* immark.c
* This is the implementation of the build-in mark message input module.
*
* NOTE: read comments in module-template.h to understand how this file
@@ -30,13 +30,21 @@
* A copy of the GPL can be found in the file "COPYING" in this distribution.
*/
#include "config.h"
-#if 0 /* IMMARK */
+#if 1 /* IMMARK */
#include <stdlib.h>
#include <stdio.h>
+#include <assert.h>
#include <signal.h>
+#include <string.h>
#include <pthread.h>
#include "rsyslog.h"
#include "syslogd.h"
+#include "module-template.h"
+
+MODULE_TYPE_INPUT
+
+typedef struct _instanceData {
+} instanceData;
/* This function is called to gather input. It must terminate only
* a) on failure (iRet set accordingly)
@@ -58,15 +66,15 @@ immark_runInput(void)
sigfillset(&sigSet);
pthread_sigmask(SIG_BLOCK, &sigSet, NULL);
sigemptyset(&sigSet);
- sigaddset(&sigSet, SIGTERM);
- sigaddset(&sigSet, SIGHUP);
+ sigaddset(&sigSet, SIGUSR2);
pthread_sigmask(SIG_UNBLOCK, &sigSet, NULL);
-dbgprintf("immark_runInput running!\n");
while(!bFinished) {
dbgprintf("immark pre select\n");
- tvSelectTimeout.tv_sec = 500;
+ tvSelectTimeout.tv_sec = 5;
tvSelectTimeout.tv_usec = 0;
select(0, NULL, NULL, NULL, &tvSelectTimeout);
+ if(bFinished)
+ break;
dbgprintf("immark post select, doing mark, bFinished: %d\n", bFinished);
logmsgInternal(LOG_INFO, "-- MARK --", ADDDATE);
//logmsgInternal(LOG_INFO, "-- MARK --", ADDDATE|MARK);
@@ -74,6 +82,32 @@ dbgprintf("immark post select, doing mark, bFinished: %d\n", bFinished);
fprintf(stderr, "immark: finished!\n");
return RS_RET_OK;
}
+
+BEGINfreeInstance
+CODESTARTfreeInstance
+ENDfreeInstance
+
+
+BEGINdbgPrintInstInfo
+CODESTARTdbgPrintInstInfo
+ENDdbgPrintInstInfo
+
+
+BEGINmodExit
+CODESTARTmodExit
+ENDmodExit
+
+
+BEGINqueryEtryPt
+CODESTARTqueryEtryPt
+CODEqueryEtryPt_STD_IMOD_QUERIES
+ENDqueryEtryPt
+
+
+BEGINmodInit()
+CODESTARTmodInit
+ *ipIFVersProvided = 1; /* so far, we only support the initial definition */
+ENDmodInit
#endif /* #if 0 */
/*
* vi:set ai:
diff --git a/plugins/ommysql/ommysql.c b/plugins/ommysql/ommysql.c
index e8e53e76..d67d92eb 100644
--- a/plugins/ommysql/ommysql.c
+++ b/plugins/ommysql/ommysql.c
@@ -44,6 +44,8 @@
#include "ommysql.h"
#include "module-template.h"
+MODULE_TYPE_OUTPUT
+
/* internal structures
*/
DEF_OMOD_STATIC_DATA
diff --git a/plugins/ompgsql/ompgsql.c b/plugins/ompgsql/ompgsql.c
index 94f22510..45e3c674 100644
--- a/plugins/ompgsql/ompgsql.c
+++ b/plugins/ompgsql/ompgsql.c
@@ -43,6 +43,8 @@
#include "ompgsql.h"
#include "module-template.h"
+MODULE_TYPE_OUTPUT
+
/* internal structures
*/
DEF_OMOD_STATIC_DATA