wmoran has asked for the wisdom of the Perl Monks concerning the following question:

I'm trying to work with a specific application and getting hung up with an error I don't understand. While I am waiting for the app author to get back to me, I'd like to further my own understanding by getting an idea of what's going on.

I'm trying to run Postgrey (http://isg.ee.ethz.ch/tools/postgrey/) on FreeBSD 4.10, with Posfix 2.1.1 and perl 5.6.1 and BerkeleyDB-0.25.

when I try to run Postgrey I get the following error:

Your vendor has not defined BerkeleyDB macro DB_AUTO_COMMIT, used at /usr/local/bin/postgrey line 178

Looking at the source to BerkeleyDB.pm, I can't say I understand what's going on. Seems like DB_AUTO_COMMIT is exported but never declared. Perhaps I'm demonstrating how little I understand about perl, but that's why I'm asking a question.

Can anyone explain what's wrong, or point me to a document that will enlighten me?

Replies are listed 'Best First'.
Re: Errors with BerkeleyDB
by hsinclai (Deacon) on Jun 06, 2004 at 18:47 UTC
    Hey I have a feeling the prob is with your system's db libs. Was that a fresh 4.10 install or have you brought it to this level from earlier 4.x.x versions by "building world"? If older db perhaps need to upgrade libs.. I've had to fiddle with this on certain apps, squidGuard comes to mind.. needing specific BerkleyDB versions.. the postgrey docs make no mention of db version.. hm

    Just a guess, but I think it's nothing to do with Perl .. IIRC the postfix build doesn't require specific db libs, can work with older ones, it won't complain.. so you'd never get a complaint..

    update: if you do get a reply from the author I'd be interested in hearing any comment..

      I did hear back from the author. The problem was that I was using db3 and the docs clearly state that db4.1 or newer is required. I looked through the Makefile for the p5-BerkeleyDB port, and used the option to build it with db4.1 ... all works great now.

      I appreciate your input, but the real reason I asked was to gain a better understanding of perl. Usually I'm able to read through source code and figure things out like this, but in this case I was totally lost, and I susped it has something to do with my understanding of perl not being good enough. I simply don't understand how that constant is ever getting set.

        Ah I thought as much.. ;-) ( I mean that it was a DB version issue, not Perl or modules)

        The constants.h file in the BerkeleyDB source references the functions; when you build the module, you end up with a shared library, BerkeleyDB.so -- once postgrey invokes BerkeleyDB,
        use BerkeleyDB;
        you've got access to all the functions..