[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: How do I run a query on the bdb database before I've started listening for incoming request?

Hi Quanah:

I'm doing this experimental hack ( solely for the purpose of understanding the code base as well as I can )

I'm trying to add dynamic schema updates. Here's what I've done
a) Created a separate naming context for the schema
b) Populated it with a bunch of "objectclass" objects and "attribute" objects (Initially I've written fresh .schema files to support this)
c) Now at startup time, before slapd starts listening, I load the "objectclass" objects and "attribute" objects to generate the global schema datastructures. Because I'm doing dynamic schema updates, I've wrapped the schema data structures with a CREW lock
d) My next goal is to have a schema refresh thread which is kicked off every time a ldap_add is done on this naming context. This is for reloading the global schema datastructures.
i) slight issue here is when do you trigger these updates - do you wait for some amount of time/lock the naming context down when you do the refresh... need to work this out.
e) If I accomplish d) and e) I should be able to use ldap requests to dynamically update the schema.

I'd like to get away from using the .schema files : I'd probably try and build some form of an initialize_database function that does the bootstrap later on down the line. So that once you fire up slapd, it reads its schema files not from the slapd.conf but from my datastore.

I found out that slapcat uses bdb_tool_entry_get and there's code in there which also does a test_filter which seems like it supports search expressions. The man pages don't register that. (is this accurate? Does slapcat support query expressions. All I plan to do for now is call the equivalent of slapcat functionality before slapd_daemon() is invoked and read my schema.)


----- Original Message ----- From: "Quanah Gibson-Mount" <quanah@stanford.edu>
To: "Krishna Ganugapati" <krishnag@marakicorp.com>; <openldap-software@OpenLDAP.org>
Sent: Wednesday, November 09, 2005 12:03 PM
Subject: Re: How do I run a query on the bdb database before I've started listening for incoming request?

--On Tuesday, November 08, 2005 7:12 PM -0800 Krishna Ganugapati <krishnag@marakicorp.com> wrote:


I've managed to get both my naming contexts up and functional.

I want to be able to run a query within slapd before I've started
listening (before main.c/slapd_daemon()

Out of curiosity, *why* do you want to do this?


Quanah Gibson-Mount
Principal Software Developer
ITSS/Shared Services
Stanford University
GnuPG Public Key: http://www.stanford.edu/~quanah/pgp.html