On Wed, Sep 9, 2009 at 1:36 AM, koitoer
<koitoer.server@gmail.com> wrote:
Hello everybody,
I have the next problem. When I tried to add new records to my ldap server , this take a long time, and never do it.
First of all I install openldap from sources with those commands
env CPPFLAGS="-I/usr/local/include -I/usr/local/BerkeleyDB.4.7/include -I/usr/local/ssl/include/openssl" LDFLAGS="-L/usr/local/lib -L/usr/local/BerkeleyDB.4.7/lib -L/usr/local/ssl/lib -R/usr/local/lib -R/usr/local/BerkeleyDB.4.7/lib -R/usr/local/ssl/lib" LD_LIBRARY_PATH="/usr/local/BerkeleyDB.4.7/lib"
./configure --with-tls --enable-slurpd --enable-crypt
--enable-syslog --enable-ldap --enable-ppolicy --enable-sql
--enable-dynamic --enable-modules --enable-backends=mod
--enable-overlays=mod --prefix=/etc
make depend
make
make test
make install
And no error appears.
So then when I run this command, openldap takes long time, and never response or do something
koitoerlp:/etc/etc/openldap# ldapadd -a -x -W -D "cn=manager,dc=koitoerldap,dc=com" -f koitoerldap.ldif
Enter LDAP Password: < = LDAP dont send any message or error only wait for the answer but it never comes.
The koitoerldap.ldif is :
dn: ou=Mounts,dc=koitoerldap,dc=com
ou: Mounts
objectClass: top
objectClass: organizationalUnit
dn: ou=Networks,dc=koitoerldap,dc=com
ou: Networks
objectClass: top
objectClass: organizationalUnit
dn: ou=People,dc=koitoerldap,dc=com
ou: People
objectClass: top
objectClass: organizationalUnit
In the debug mode of ldap I see this before the ldapadd command when i run this command
/etc/libexec/slapd -d 1 start
@(#) $OpenLDAP: slapd 2.4.16 (Sep 7 2009 16:27:31) $
root@koitoerlp:/usr/src/openldap-2.4.16/servers/slapd
ldap_pvt_gethostbyname_a: host=koitoerlp, r=0
daemon_init: listen on ldap:///
daemon_init: 1 listeners to open...
ldap_url_parse_ext(ldap:///)
daemon: listener initialized ldap:///
daemon_init: 2 listeners opened
ldap_create
slapd init: initiated server.
slap_sasl_init: initialized!
bdb_back_initialize: initialize BDB backend
bdb_back_initialize: Berkeley DB 4.7.25: (May 15, 2008)
hdb_back_initialize: initialize HDB backend
hdb_back_initialize: Berkeley DB 4.7.25: (May 15, 2008)
==>sql_back_initialize()
<==sql_back_initialize()
bdb_db_init: Initializing BDB database
>>> dnPrettyNormal: <dc=koitoerldap,dc=com>
<<< dnPrettyNormal: <dc=koitoerldap,dc=com>, <dc=koitoerldap,dc=com>
>>> dnPrettyNormal: <cn=Manager,dc=koitoerldap,dc=com>
<<< dnPrettyNormal: <cn=Manager,dc=koitoerldap,dc=com>, <cn=manager,dc=koitoerldap,dc=com>
>>> dnNormalize: <cn=Subschema>
<<< dnNormalize: <cn=subschema>
matching_rule_use_init
??????????????? Ommited some lines
slapd startup: initiated.
backend_startup_one: starting "cn=config"
config_back_db_open
config_build_entry: "cn=config"
config_build_entry: "cn=schema"
config_build_entry: "cn={0}core"
config_build_entry: "cn={1}cosine"
config_build_entry: "cn={2}nis"
config_build_entry: "cn={3}inetorgperson"
config_build_entry: "olcDatabase={-1}frontend"
config_build_entry: "olcDatabase={0}config"
config_build_entry: "olcDatabase={1}bdb"
backend_startup_one: starting "dc=koitoerldap,dc=com"
bdb_db_open: database "dc=koitoerldap,dc=com": unclean shutdown detected; attempting recovery.
bdb_db_open: database "dc=koitoerldap,dc=com": dbenv_open(/etc/var/openldap-data).
bdb_monitor_db_open: monitoring disabled; configure monitor database to enable
slapd starting
When I launch the ldapadd command my debug mode ldap shows
slapd starting
slap_listener_activate(8):
>>> slap_listener(ldap:///)
connection_get(12): got connid=0
connection_read(12): checking for input on id=0
ber_get_next
ber_get_next: tag 0x30 len 51 contents:
ber_get_next
conn=0 op=0 do_bind
ber_scanf fmt ({imt) ber:
ber_scanf fmt (m}) ber:
>>> dnPrettyNormal: <cn=manager,dc=koitoerldap,dc=com>
<<< dnPrettyNormal: <cn=manager,dc=koitoerldap,dc=com>, <cn=manager,dc=koitoerldap,dc=com>
do_bind: version=3 dn="cn=manager,dc=koitoerldap,dc=com" method=128
do_bind: v3 bind: "cn=manager,dc=koitoerldap,dc=com" to "cn=manager,dc=koitoerldap,dc=com"
send_ldap_result: conn=0 op=0 p=3
send_ldap_response: msgid=1 tag=97 err=0
ber_flush2: 14 bytes to sd 12
connection_get(12): got connid=0
connection_read(12): checking for input on id=0
ber_get_next
ber_get_next: tag 0x30 len 98 contents:
ber_get_next
conn=0 op=1 do_add
ber_scanf fmt ({m) ber:
ber_scanf fmt ({m{W}}) ber:
ber_scanf fmt ({m{W}}) ber:
ber_scanf fmt (}) ber:
>>> dnPrettyNormal: <ou=Mounts,dc=koitoerldap,dc=com>
<<< dnPrettyNormal: <ou=Mounts,dc=koitoerldap,dc=com>, <ou=mounts,dc=koitoerldap,dc=com>
bdb_dn2entry("ou=mounts,dc=koitoerldap,dc=com")
=> bdb_dn2id("dc=koitoerldap,dc=com")
<= bdb_dn2id: got id=0x1
=> bdb_dn2id("ou=mounts,dc=koitoerldap,dc=com")
And never past this command, to finish I have to kill openldap process, I think is a problem maybe in db but im not sure.
Maybe in my installation, I tried to change some parameters in the slapd.conf but it doesnt work.
In some case openldap insert the first record in the ldif file, but in the second this actions comes again, and no more record will be insert.
My ldap.conf , slapd.conf and DB.CONFIG
HOST 127.0.0.1
BASE dc=koitoerldap,dc=com
koitoerlp:/etc/etc/openldap# cat slapd.conf
#
# See slapd.conf(5) for details on configuration options.
# This file should NOT be world readable.
#
include /etc/etc/openldap/schema/core.schema
include /etc/etc/openldap/schema/cosine.schema
include /etc/etc/openldap/schema/nis.schema
include /etc/etc/openldap/schema/inetorgperson.schema
pidfile /etc/var/run/slapd.pid
argsfile /etc/var/run/slapd.args
# Load dynamic backend modules:
# modulepath /etc/libexec/openldap
moduleload back_bdb.la
# moduleload back_hdb.la
# moduleload back_ldap.la
#######################################################################
# BDB database definitions
#######################################################################
database bdb
suffix "dc=koitoerldap,dc=com"
rootdn "cn=Manager,dc=koitoerldap,dc=com"
# Cleartext passwords, especially for the rootdn, should
# be avoid. See slappasswd(8) and slapd.conf(5) for details.
# Use of strong authentication encouraged.
rootpw {SSHA}HO3g6J/KgbIUQGsanP8ld9hrEyPNhfKs
# The database directory MUST exist prior to running slapd AND
# should only be accessible by the slapd and slap tools.
# Mode 700 recommended.
directory /etc/var/openldap-data
# Indices to maintain
index objectClass eq
cat /etc/var/openldap-data/DB_CONFIG
# one 0.25 GB cache
set_cachesize 0 268435456 1
# Data Directory
#set_data_dir db
# Transaction Log settings
set_lg_regionmax 262144
set_lg_bsize 2097152
#set_lg_dir logs
finally when I tried to login in phpopenldapadmin, I have the same trouble when I click in the login button, this message appears in the openldap debug mode
slapd starting
slap_listener_activate(8):
>>> slap_listener(ldap:///)
connection_get(12): got connid=0
connection_read(12): checking for input on id=0
ber_get_next
ber_get_next: tag 0x30 len 51 contents:
ber_get_next
conn=0 op=0 do_bind
ber_scanf fmt ({imt) ber:
ber_scanf fmt (m}) ber:
>>> dnPrettyNormal: <cn=manager,dc=koitoerldap,dc=com>
<<< dnPrettyNormal: <cn=manager,dc=koitoerldap,dc=com>, <cn=manager,dc=koitoerldap,dc=com>
do_bind: version=3 dn="cn=manager,dc=koitoerldap,dc=com" method=128
do_bind: v3 bind: "cn=manager,dc=koitoerldap,dc=com" to "cn=manager,dc=koitoerldap,dc=com"
send_ldap_result: conn=0 op=0 p=3
send_ldap_response: msgid=1 tag=97 err=0
ber_flush2: 14 bytes to sd 12
connection_get(12): got connid=0
connection_read(12): checking for input on id=0
ber_get_next
ber_get_next: tag 0x30 len 5 contents:
ber_get_next
conn=0 op=1 do_unbind
connection_close: conn=0 sd=12
slap_listener_activate(8):
>>> slap_listener(ldap:///)
connection_get(12): got connid=1
connection_read(12): checking for input on id=1
ber_get_next
ber_get_next: tag 0x30 len 51 contents:
ber_get_next
conn=1 op=0 do_bind
ber_scanf fmt ({imt) ber:
ber_scanf fmt (m}) ber:
>>> dnPrettyNormal: <cn=manager,dc=koitoerldap,dc=com>
<<< dnPrettyNormal: <cn=manager,dc=koitoerldap,dc=com>, <cn=manager,dc=koitoerldap,dc=com>
do_bind: version=3 dn="cn=manager,dc=koitoerldap,dc=com" method=128
do_bind: v3 bind: "cn=manager,dc=koitoerldap,dc=com" to "cn=manager,dc=koitoerldap,dc=com"
send_ldap_result: conn=1 op=0 p=3
send_ldap_response: msgid=1 tag=97 err=0
ber_flush2: 14 bytes to sd 12
connection_get(12): got connid=1
connection_read(12): checking for input on id=1
ber_get_next
ber_get_next: tag 0x30 len 67 contents:
ber_get_next
conn=1 op=1 do_search
ber_scanf fmt ({miiiib) ber:
>>> dnPrettyNormal: <dc=koitoerldap,dc=com>
<<< dnPrettyNormal: <dc=koitoerldap,dc=com>, <dc=koitoerldap,dc=com>
ber_scanf fmt (m) ber:
ber_scanf fmt ({M}}) ber:
=> bdb_search
bdb_dn2entry("dc=koitoerldap,dc=com")
=> bdb_dn2id("dc=koitoerldap,dc=com")
<= bdb_dn2id: got id=0x1
entry_decode: "dc=koitoerldap,dc=com"
<= entry_decode(dc=koitoerldap,dc=com)
=> bdb_dn2id_children("dc=koitoerldap,dc=com")
<= bdb_dn2id_children("dc=koitoerldap,dc=com"): (0)
=> send_search_entry: conn 1 dn="dc=koitoerldap,dc=com"
ber_flush2: 514 bytes to sd 12
<= send_search_entry: conn 1 exit.
send_ldap_result: conn=1 op=1 p=3
send_ldap_response: msgid=2 tag=101 err=0
ber_flush2: 14 bytes to sd 12
connection_get(12): got connid=1
connection_read(12): checking for input on id=1
ber_get_next
ber_get_next: tag 0x30 len 538 contents:
ber_get_next
conn=1 op=2 do_search
ber_scanf fmt ({miiiib) ber:
>>> dnPrettyNormal: <>
<<< dnPrettyNormal: <>, <>
ber_scanf fmt (m) ber:
ber_scanf fmt ({M}}) ber:
=> send_search_entry: conn 1 dn=""
ber_flush2: 778 bytes to sd 12
<= send_search_entry: conn 1 exit.
send_ldap_result: conn=1 op=2 p=3
send_ldap_response: msgid=3 tag=101 err=0
ber_flush2: 14 bytes to sd 12
connection_get(12): got connid=1
connection_read(12): checking for input on id=1
ber_get_next
ber_get_next: tag 0x30 len 78 contents:
ber_get_next
conn=1 op=3 do_search
ber_scanf fmt ({miiiib) ber:
>>> dnPrettyNormal: <cn=manager,dc=koitoerldap,dc=com>
<<< dnPrettyNormal: <cn=manager,dc=koitoerldap,dc=com>, <cn=manager,dc=koitoerldap,dc=com>
ber_scanf fmt (m) ber:
ber_scanf fmt ({M}}) ber:
=> bdb_search
bdb_dn2entry("cn=manager,dc=koitoerldap,dc=com")
=> bdb_dn2id("cn=manager,dc=koitoerldap,dc=com")
And again neves past this point, I dont know why, maybe I install bad openldap and need more parameters.
Please dont say me install with apt-get , I want to make this from source, but a few time ago I install with apt and this error not appear, but in this case I want to make without apt.
Any suggestion, opinion or help will be useful and graceful.
In advance thanks a lot.