LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 09-27-2009, 08:59 PM   #1
defeater_man
LQ Newbie
 
Registered: Sep 2009
Posts: 6

Rep: Reputation: 0
ldap_bind:cannot contact to ldap (-1)


I am new in ldap

i have install my openldap2,openldap2_client,nss_ldap,pam_ldap,db42 on suse enterprise10 and configure my ldap and add some organisation and users by ldapadd in DIT
buy when i restart my pc and try to enter again after 2 days
I tried to enter some ldap user but the follwing error appear

ldap_bind:cannot contact to ldap (-1)

and also when i try to search in my DIT same error occure

Hint: ldap are running and no errors occure

and i want to know how to listen to ldap port?
 
Old 09-28-2009, 12:13 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
If slapd is running, try to stop it and then start it again from command line in debug mode.
Code:
/usr/lib/openldap/slapd -d 65535
Quote:
and i want to know how to listen to ldap port?
The slapd daemon is listening on port 389. To verify:
Code:
netstat -tanpl|grep 389
Regards
 
Old 09-28-2009, 10:01 AM   #3
defeater_man
LQ Newbie
 
Registered: Sep 2009
Posts: 6

Original Poster
Rep: Reputation: 0
thank you man for your fast reply

i write the command of starting ldap and the result of the last 3 lines

Quote:
backend_startup: starting "dc=my-domain,dc=com"
bdb_db_open: dc=my-domain,dc=com
bdb_db_open: dbenv_open(/var/lib/ldap)
then it stop and diddnot continue

and when i listen to port 389 nothing done
 
Old 09-28-2009, 11:17 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Strange that slapd stops at "bdb_db_open: dbenv_open(/var/lib/ldap)". Does is seems hanged? What is the output of
Code:
ps -ef|grep slapd
after running the slapd in debug mode?
Also what gives:
Code:
ls -la /var/lib/ldap
 
Old 09-28-2009, 02:25 PM   #5
defeater_man
LQ Newbie
 
Registered: Sep 2009
Posts: 6

Original Poster
Rep: Reputation: 0
the output of ps -ef | grep slapd
Quote:
root 7539 7499 1 02:09 pts/0 00:03:00 /usr/lib/openldap/slapd -d 65535
root 7601 7499 0 02:13 pts/0 00:00:00 /usr/lib/openldap/slapd -d 65535
root 12693 7499 0 06:34 pts/0 00:00:00 grep slapd
and what u mean by debug mode sorry iam beginer in ldap so i donnot know what u mean by debug mode

and the output of ls -la /var/lib/ldap

Quote:
drwx------ 2 ldap ldap 328 Sep 27 03:20 .
drwxr-xr-x 38 root root 992 Sep 23 19:04 ..
-rw------- 1 ldap ldap 48 Sep 9 2005 DB_CONFIG
-rw------- 1 ldap ldap 24576 Sep 23 17:42 __db.001
-rw------- 1 ldap ldap 18759680 Sep 23 17:42 __db.002
-rw------- 1 ldap ldap 2162688 Sep 23 17:42 __db.003
-rw------- 1 ldap ldap 450560 Sep 23 17:42 __db.004
-rw------- 1 ldap ldap 24576 Sep 23 17:42 __db.005
-rw------- 1 ldap ldap 8192 Sep 23 20:16 dn2id.bdb
-rw------- 1 ldap ldap 32768 Sep 23 20:16 id2entry.bdb
-rw------- 1 ldap ldap 10485760 Sep 23 20:16 log.0000000001
-rw------- 1 ldap ldap 8192 Sep 23 20:16 objectClass.bdb
and i want to point that i cannot listen to port 389 is that normal?
 
Old 09-28-2009, 05:27 PM   #6
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Debug mode is when you run slapd with the "-d" option, so it does not run in the background and produces more verbose output.
From the ps output, you have 2 slapd processes running (hanged?). You can kill them, try to recover the database, restart and see if it works. To do all of the above you need to run the following commands:
Code:
pkill slapd
cd /var/lib/ldap
db_recover -v
/usr/lib/openldap/slapd -d 65535
Could you also post the openldap and BerkeleyDB versions, how you installed them and also slapd.conf?
 
Old 09-28-2009, 06:00 PM   #7
defeater_man
LQ Newbie
 
Registered: Sep 2009
Posts: 6

Original Poster
Rep: Reputation: 0
thank you for your fast reply

the command
Quote:
db_recover -v
command not found

i change my dn but still the problem

my ldap installed package

Quote:
rpm -qa | grep ldap
yast2-ldap-2.12.2-2
pam_ldap-178-3
openldap2-client-2.2.27-6
multisync-ldap-0.82+cvs-8
nss_ldap-238-2
yast2-ldap-client-2.12.9-2
openldap2-2.2.27-6
ldapcpplib-0.0.3-33
while BerkeleyDB versions

Quote:
rpm -qa | grep db
db-4.3.27-7
dbus-1-0.35.2-8
libcddb-1.2.1-2
gdbm-1.8.3-232
libgnomedb-1.3.91-5
dbus-1-python-0.35.2-8
db42-4.2.52-5
dbus-1-qt-0.35.2-8
dbus-1-mono-0.35.2-8
db42-devel-4.2.52-5
dbus-1-glib-0.35.2-8
dbus-1-x11-0.35.2-8
dbus-1-gtk-0.35.2-8
gdb-6.3-20
 
Old 09-28-2009, 06:50 PM   #8
defeater_man
LQ Newbie
 
Registered: Sep 2009
Posts: 6

Original Poster
Rep: Reputation: 0
i think that the problem is not from the packages because i aready installed them and ldap runnung normal but when i restart i think my ldap database corrupted by someway
so ldap cannot contact server
 
Old 09-28-2009, 08:23 PM   #9
scottro11
Member
 
Registered: Jun 2009
Location: NYC
Posts: 263

Rep: Reputation: 59
I'm not familiar with SuSE's version of LDAP, but usually it's pretty similar between distributions.

I have my own little page on LDAP. I'm not sure how useful it would be for SuSE, but perhaps the steps about setting up the config files and database might be useful.

http://home.roadrunner.com/~computertaijutsu/ldap.html
 
Old 09-29-2009, 12:15 AM   #10
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
You have to install db_utils, in order to be able to check and repair your ldap database.
Since slapd in debug mode stucks, you can try
Code:
slaptest -d -1
to see if you get any useful results.
 
Old 10-01-2009, 03:36 PM   #11
defeater_man
LQ Newbie
 
Registered: Sep 2009
Posts: 6

Original Poster
Rep: Reputation: 0
i instal db-utilts and run db_recovery the result was :

Quote:
db_recover -v Finding last valid log LSN: file: 1 offset 64236
Recovery starting from [1][64052]
Recovery complete at Thu Oct 1 07:46:24 2009
Maximum transaction ID 80000002 Recovery checkpoint [1][64236]
then i do slaptest -d -l the result of last 6 lines

Quote:
config file testing succeeded
slaptest shutdown: freeing system resources.
bdb(dc=linuxcbt,dc=internal): Database handles remain at environment close
bdb(dc=linuxcbt,dc=internal): Open database handle: dn2id.bdb
bdb(dc=linuxcbt,dc=internal): Open database handle: id2entry.bdb
bdb_db_destroy: close failed: Invalid argument (22)
AND THE PROBLEM STILL AS IT IS
 
Old 10-01-2009, 04:19 PM   #12
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Well, I don't know what is the problem with the database. Are you sure it's not some security thing, like SELinux or Apparmor?
If it's not a security problem, you can (re)move everything from /var/lib/ldap (make sure slapd is not running), use slapadd to add your initial ldif, start slapd and see what happens.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LDAP: Can't contact master ldap server rulirahm Linux - Networking 2 07-14-2014 02:02 AM
ldap_bind Can't contact LDAP server mesh2005 Linux - Networking 17 06-19-2014 08:44 AM
ldap_bind: Can't contact LDAP server (-1) ramramu Linux - Networking 1 01-06-2009 06:37 AM
Ubuntu Hardy (php-ldap):Can't contact LDAP server eantoranz Programming 7 12-02-2008 06:40 PM
ldap: ldap_bind: Invalid credentials (49) (using user migrated with padl) eantoranz Linux - Software 1 09-05-2008 09:52 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 12:06 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration