Discussion:
Question on back-perl
Andrea Cirulli
2010-04-08 15:40:52 UTC
Permalink
Just for fun I was testing the perl backend for openldap.

I starting setting up an LDAP using the SampleLdap.pm perl library in the
source code.

My goal is to setup a consumer LDAP in synch with other LDAP (bdb backend)
for keeping the mod add del etc. using the syncrepl mechanism.

I want to wrap every modification in the Master LDAP and triggering some
perl script.

I'm very new to this approach and the first problem I'm facing is how to
keep the last db state after a slapd crash or shutdown.

Using SamplLdap.pm init it's just a subroutine returning 0, so after the
first sync if I shutdown the slapd next time I will need a full resync.

Do you know some other clever examples? I mean keeping the state of the LDAP
and triggering, for example recording on files, the modifications on LDAP.

I tried to add in the subroutine some operation on FILES (using standard
open FILE....;print FILE "operation"; close (FILE)) it seems do not work.

Many thanks to all!
--
Andrea Cirulli
Andy Cobaugh
2010-04-08 16:33:16 UTC
Permalink
If all you want to do is trigger based on add/del/mod, May I suggest you
take a look at the auditlog overlay? It will let you store changes in LDIF
format to a file, which you could later parse very easily with something
like Perl.

--andy
Andrea Cirulli
2010-04-08 16:59:43 UTC
Permalink
Thank you andy for the suggestions!

This approach can be considered an offline one...I was looking for an online
approach ( a sort of interception of add mod del and then an action related
to that).

Furthermore, I would want to dig into this new backend to understand the
potentiality.

However I am still stuck on how to mantain the state of ldap avoiding full
sync in case of shutting down and crash.

And if someone have a good example of a working perl backend (SampleLdap
it's just a skeleton).

Thank you again!
Post by Andy Cobaugh
If all you want to do is trigger based on add/del/mod, May I suggest you
take a look at the auditlog overlay? It will let you store changes in LDIF
format to a file, which you could later parse very easily with something
like Perl.
--andy
--
Andrea Cirulli
Buchan Milne
2010-04-09 11:37:32 UTC
Permalink
Post by Andrea Cirulli
Just for fun I was testing the perl backend for openldap.
I starting setting up an LDAP using the SampleLdap.pm perl library in the
source code.
My goal is to setup a consumer LDAP in synch with other LDAP (bdb backend)
for keeping the mod add del etc. using the syncrepl mechanism.
Another option may be to have a standalone perl LDAP syncrepl consumer, such
as is possible with Net::LDAPapi.

I needed to intercept changes and effect them in a different system during a
long-ish migration (a few months), and used this approach.

Regards,
Buchan

Loading...