summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-02-15 07:48:07 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-02-15 07:48:07 +0000
commit70d90f5bae2728faed319a03f75e64a50f88a159 (patch)
tree2803bd80fcc115e86b5ea55f4ea3f427905f854b
parent15904a35388aafcda76ed44caab9222619901dd4 (diff)
downloadrsyslog-70d90f5bae2728faed319a03f75e64a50f88a159.tar.gz
rsyslog-70d90f5bae2728faed319a03f75e64a50f88a159.tar.xz
rsyslog-70d90f5bae2728faed319a03f75e64a50f88a159.zip
did some more work on omlibdbi, but did not yet get libdbi working. I guess
its a compile problem, but have not found it so far.
-rw-r--r--configure.ac2
-rw-r--r--plugins/omlibdbi/omlibdbi.c22
-rw-r--r--rsyslog.h1
-rw-r--r--syslogd.c2
4 files changed, 24 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index 6bae1c98..ca07be34 100644
--- a/configure.ac
+++ b/configure.ac
@@ -398,7 +398,7 @@ if test "x$enable_libdbi" = "xyes"; then
[dbi],
[dbi_initialize],
[libdbi_cflags=""
- libdbi_libs="-ldbi"
+ libdbi_libs="-lm -ldl -ldbi"
],
[AC_MSG_FAILURE([libdbi library is missing])]
)
diff --git a/plugins/omlibdbi/omlibdbi.c b/plugins/omlibdbi/omlibdbi.c
index 959a3424..02b56b51 100644
--- a/plugins/omlibdbi/omlibdbi.c
+++ b/plugins/omlibdbi/omlibdbi.c
@@ -148,11 +148,29 @@ reportDBError(instanceData *pData, int bSilent)
static rsRetVal initConn(instanceData *pData, int bSilent)
{
DEFiRet;
+ int iDrvrsLoaded;
ASSERT(pData != NULL);
ASSERT(pData->conn == NULL);
- dbi_initialize(NULL);
+ iDrvrsLoaded = dbi_initialize(NULL);
+ //iDrvrsLoaded = dbi_initialize("/usr/lib64/dbd/");
+RUNLOG_VAR("%d", iDrvrsLoaded);
+ if(iDrvrsLoaded == 0) {
+ logerror("libdbi error: no dbi drivers present on this system - suspending. Install drivers!");
+ ABORT_FINALIZE(RS_RET_SUSPENDED);
+ }
+
+ // debug drivers
+ dbi_driver drvr;
+ drvr = NULL;
+ do {
+RUNLOG;
+ drvr = dbi_driver_list(drvr);
+ dbgprintf("driver: '%s'\n", dbi_driver_get_name(drvr));
+ } while(drvr != NULL);
+
+RUNLOG_VAR("%s", pData->drvrName);
pData->conn = dbi_conn_new((char*)pData->drvrName);
if(pData->conn == NULL) {
logerror("can not initialize libdbi connection");
@@ -172,6 +190,7 @@ RUNLOG_STR("trying dbi connect");
}
}
+finalize_it:
RETiRet;
}
@@ -241,7 +260,6 @@ CODE_STD_STRING_REQUESTparseSelectorAct(1)
ABORT_FINALIZE(RS_RET_CONFLINE_UNPROCESSED);
}
- FINALIZE;
/* ok, if we reach this point, we have something for us */
CHKiRet(createInstance(&pData));
diff --git a/rsyslog.h b/rsyslog.h
index 3826e18d..cdea4091 100644
--- a/rsyslog.h
+++ b/rsyslog.h
@@ -121,6 +121,7 @@ enum rsRetVal_ /** return value. All methods return this if not specified oth
RS_RET_NO_FILEPREFIX = -2045, /**< file prefix is not specified where one is needed */
RS_RET_CONFIG_ERROR = -2046, /**< there is a problem with the user-provided config settigs */
RS_RET_OUT_OF_DESRIPTORS = -2047, /**< a descriptor table's space has been exhausted */
+ RS_RET_NO_DRIVERS = -2048, /**< a required drivers missing */
RS_RET_OK_DELETE_LISTENTRY = 1, /**< operation successful, but callee requested the deletion of an entry (special state) */
RS_RET_TERMINATE_NOW = 2, /**< operation successful, function is requested to terminate (mostly used with threads) */
RS_RET_NO_RUN = 3, /**< operation successful, but function does not like to be executed */
diff --git a/syslogd.c b/syslogd.c
index 71378f6e..e8776d65 100644
--- a/syslogd.c
+++ b/syslogd.c
@@ -3753,6 +3753,7 @@ rsRetVal addAction(action_t **ppAction, modInfo_t *pMod, void *pModData, omodStr
* does not request any templates. This sounds unlikely, but an actual example is
* the discard action, which does not require a string. -- rgerhards, 2007-07-30
*/
+RUNLOG_VAR("%d", pAction->iNumTpls);
if(pAction->iNumTpls > 0) {
/* we first need to create the template pointer array */
if((pAction->ppTpl = calloc(pAction->iNumTpls, sizeof(struct template *))) == NULL) {
@@ -3766,6 +3767,7 @@ rsRetVal addAction(action_t **ppAction, modInfo_t *pMod, void *pModData, omodStr
* template (Hint: templates MUST be defined before they are
* used!)
*/
+RUNLOG_VAR("%s", pTplName);
if((pAction->ppTpl[i] = tplFind((char*)pTplName, strlen((char*)pTplName))) == NULL) {
snprintf(errMsg, sizeof(errMsg) / sizeof(char),
" Could not find template '%s' - action disabled\n",