BDB despite apparent lack of BDB databases

Boylan, Ross Ross.Boylan at ucsf.edu
Tue May 23 15:21:54 EDT 2017


In partial answer to my original question,  cyrusdb.c contains (in 2.4)
struct cyrusdb_backend *cyrusdb_backends[] = {
#ifdef HAVE_BDB
    &cyrusdb_berkeley,
    &cyrusdb_berkeley_nosync,
    &cyrusdb_berkeley_hash,
    &cyrusdb_berkeley_hash_nosync,
#endif
    &cyrusdb_flat,
    &cyrusdb_skiplist,
    &cyrusdb_quotalegacy,
#if defined HAVE_MYSQL || defined HAVE_PGSQL || defined HAVE_SQLITE
    &cyrusdb_sql,
#endif
    NULL };

void cyrusdb_init()
{
    int i, r;
    char dbdir[1024];
    const char *confdir = libcyrus_config_getstring(CYRUSOPT_CONFIG_DIR);
    int initflags = libcyrus_config_getint(CYRUSOPT_DB_INIT_FLAGS);

    strcpy(dbdir, confdir);
    strcat(dbdir, FNAME_DBDIR);

    for(i=0; cyrusdb_backends[i]; i++) {
        r = (cyrusdb_backends[i])->init(dbdir, initflags);
        if(r) {
            syslog(LOG_ERR, "DBERROR: init() on %s",
                   cyrusdb_backends[i]->name);
        }
    }
}

Since mine was compiled with BDB supported (presumably) the berkeley backends are there and cyrusdb_init() tries to initialize them even if none of my actual databasess are using a BDB format.

I think my best move would be to find the initialization logic that creates the db directory and do that to create an emptyish directory (if tools/mkimap is a guide it looks as if I should create stage. and sync. underneath it).

Ross


More information about the Info-cyrus mailing list