summaryrefslogtreecommitdiffstats
path: root/plugins/omlibdbi
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 /plugins/omlibdbi
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.
Diffstat (limited to 'plugins/omlibdbi')
-rw-r--r--plugins/omlibdbi/omlibdbi.c22
1 files changed, 20 insertions, 2 deletions
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));