|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
Hello everyone.
I'm trying to migrate an OpenLDAP database from one server to another. The old server was using Linux From Scratch and the new Server is using CentOS 5.1. I'm using a "stock" build and doing my best to try and use yum packages where ever possible. The machine was installed with Openldap-servers and openldap-clients installed. Here's my problem. If I start ldap using the "stock" configuration file, it works fine. When I start it using the config files from the other server on the new server, it segfaults. Here's the ldap.conf file from the old server that I placed onto the new server: BASE dc=eb,dc=loc URI ldap://127.0.0.1 And here's slapd.conf. You'll notice I've commented out the replication portion of things because this is a test box that doesn't have a "partner" to replicate to. include /etc/openldap/schema/core.schema include /etc/openldap/schema/cosine.schema include /etc/openldap/schema/inetorgperson.schema include /etc/openldap/schema/nis.schema include /etc/openldap/schema/sphinx.schema include /etc/openldap/schema/samba.schema include /etc/openldap/schema/qmail.schema include /etc/openldap/schema/mozilla.schema include /etc/openldap/schema/pureftpd.schema #include /etc/openldap/schema/sphinx.schema pidfile /var/run/openldap/slapd.pid argsfile /var/run/openldap/slapd.args database bdb suffix "dc=eb,dc=loc" rootdn "cn=Manager,dc=eb,dc=loc" rootpw {SSHA}garbagehere directory /var/openldap/openldap-data password-hash {MD5} password-crypt-salt-format "$1$.8s" #replogfile /etc/openldap/replog #updatedn "cn=replicator,dc=eb,dc=loc" #updateref ldap://10.255.255.xx index objectClass,uidNumber,gidNumber eq index cn,sn,uid,displayName pres,sub,eq index memberUid,givenName eq index sambaSID,sambaPrimaryGroupSID,sambaDomainName eq index default sub #access to attrs=userPassword,sambaLMPassword,sambaNTPassword # by self write # by anonymous auth # by dn="cn=replicator,dc=eb,dc=loc" write # by * none # #access to * # by dn="cn=replicator,dc=eb,dc=loc" write # by * read Now, one of the first things I did was copy over the data files from /srv/ldap to /var/openldap. Then I deleted the alock file. Then I chown -R ldap:ldap /var/openldap to allow for permissions. Just to be on the safe side, I also issued a setsebool -R slapd_disable_trans=0 so that way SELinux wouldn't interfere with it. (Is there some other way I should have done this?) Now, whenever I try to start it, I get this: [hptestlin /openldap]# service ldap start Checking configuration files for slapd: bdb_db_open: unclean shutdown detected; attempting recovery. bdb_db_open: Recovery skipped in read-only mode. Run manual recovery if errors are encountered. [ OK ] Starting slapd: [ OK ] However, I keep finding that slapd or slurpd are not listed in the process list! /var/log/messages shows this: Feb 13 16:39:02 hptestlin kernel: slaptest[22371]: segfault at 00002aaaae5a0008 rip 00002aaaaad66982 rsp 00007fffc0e08490 error 4 Feb 13 16:39:02 hptestlin kernel: slapd[22379]: segfault at 00002aaaaaacc008 rip 00002aaaaad66982 rsp 00007fff55738dc0 error 4 Doing a slapd_db_recover -v doesn't make any difference. Lastly, if I attempt to start slapd manually with a -d 4, I get this: [hptestlin openldap-data]# slapd -d 4 (#) $OpenLDAP: slapd 2.3.27 (Nov 10 2007 09:23:56) $ :/builddir/build/BUILD/openldap-2.3.27/openldap-2.3.27/build-servers/servers/slapd daemon_init: <null> => ldap_bv2dn(dc=eb,dc=loc,0) <= ldap_bv2dn(dc=eb,dc=loc)=0 => ldap_dn2bv(272) <= ldap_dn2bv(dc=eb,dc=loc)=0 => ldap_dn2bv(272) <= ldap_dn2bv(dc=eb,dc=loc)=0 => ldap_bv2dn(cn=Manager,dc=eb,dc=loc,0) <= ldap_bv2dn(cn=Manager,dc=eb,dc=loc)=0 => ldap_dn2bv(272) <= ldap_dn2bv(cn=Manager,dc=eb,dc=loc)=0 => ldap_dn2bv(272) <= ldap_dn2bv(cn=manager,dc=eb,dc=loc)=0 => ldap_bv2dn(cn=Subschema,0) <= ldap_bv2dn(cn=Subschema)=0 => ldap_dn2bv(272) <= ldap_dn2bv(cn=subschema)=0 bdb_db_open: dc=eb,dc=loc bdb_db_open: unclean shutdown detected; attempting recovery. Segmentation fault Then I figured what I had to do (maybe?) was rather than copy over the entire data directory, maybe perhaps there was some sort of a command I was supposed to run to export the data and then use another command to import the data. (slapcat and slapadd) Exporting the LDIF file worked fine from the old server. However, this was the result when I tried to import the LDIF file onto the new server: [hptestlin ~]# slapadd -v -l openldap.ldif bdb_db_open: unclean shutdown detected; attempting recovery. Segmentation fault [hptestlin ~]# And if I tail /var/log/messages, I get the following: Feb 14 08:36:25 hptestlin kernel: slapadd[25138]: segfault at 00002aaaae5a0008 rip 00002aaaaad66982 rsp 00007fff9f7d04a0 error 4 As well, the exported LDIF file is only 48K but the actual data directory is somewhere around 260 Megs, so that doesn't sound right. Should I be using ldapsearch instead to export the database and ldapadd to import it? If so, how can I do that if I can't even get the LDAP server running on the new server? I'm at my wits end here. Does anyone have any ideas? Does anyone need more information to be able to help out? I've Googled this with no luck and RTFM'ing really isn't any help, at least in the spots I looked in. Your help is highly appreciated. |
![]() |
| Viewing: Dev Shed Forums > Databases > LDAP Programming > Frustrating OpenLDAP Problem (Newbie alert!) |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|