Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
OpenLDAP - failed to start `/usr/lib64/openldap/slapd'
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Wizumwalt
Guru
Guru


Joined: 20 Aug 2006
Posts: 470

PostPosted: Wed Sep 16, 2015 12:14 am    Post subject: OpenLDAP - failed to start `/usr/lib64/openldap/slapd' Reply with quote

I've emerged openldap but can't get it to start. I'm doing this on a small local LAN, so no real domain name.

I made these changes to /etc/openldap/slapd.conf.
Code:

database        hdb
suffix          "dc=eme,dc=local"
#         <kbyte> <min>
checkpoint      32      30
rootdn          "cn=Manager,dc=eme,dc=local"                 
# 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}aDDsx9o/AbMsksL1dLnxBBX6VdnCqbrc

Always fails w/ this error.
Code:

sudo /etc/init.d/slapd start
 * Starting ldap-server ...
 * start-stop-daemon: failed to start `/usr/lib64/openldap/slapd'         [ !! ]
 * ERROR: slapd failed to start

I emerged it with these USE flags.
Code:

USE="-gtk -gnome -X -opengl bindist mmx sse sse2 ssl ipv6 perl python crypt ncurses fortran f77 pam udev thin diags opensm mstflint perftest -systemd nfsv4 nfsv4.1 libmount nfsidmap tcpd uuid berkdb nls gnutls sasl syslog -minimal"

Here's the perms.
Code:

# pwd
/var/lib/openldap-data
# ls -l
total 836
-rw------- 1 ldap ldap    845 Sep 15 18:08 DB_CONFIG.example
-rw------- 1 ldap ldap  24576 Sep 15 19:01 __db.001
-rw------- 1 ldap ldap 114688 Sep 15 19:01 __db.002
-rw------- 1 ldap ldap 270336 Sep 15 19:01 __db.003
-rw------- 1 ldap ldap 163840 Sep 15 18:20 __db.004
-rw------- 1 ldap ldap 860160 Sep 15 19:01 __db.005
-rw------- 1 ldap ldap  32768 Sep 15 19:01 __db.006
-rw-r--r-- 1 ldap ldap   2048 Sep 15 19:01 alock


Any help much appreciated.
Back to top
View user's profile Send private message
kikko
Apprentice
Apprentice


Joined: 29 Apr 2014
Posts: 256
Location: Milan, IT

PostPosted: Wed Sep 16, 2015 2:35 pm    Post subject: Reply with quote

Hi Wizumwalt
have you already tried a config test?
Code:
slaptest -v -d 1 -f /etc/openldap/slapd.conf

You can also raise the "loglevel" directive to 4 and look in /var/log/messages for errors from slapd daemon
Back to top
View user's profile Send private message
Wizumwalt
Guru
Guru


Joined: 20 Aug 2006
Posts: 470

PostPosted: Wed Sep 23, 2015 10:09 pm    Post subject: Reply with quote

I ran the slaptest line as above and posted the end of the slaptest which doesn't look normal.
Code:

...
56031cc7 slaptest startup: initiated.
56031cc7 backend_startup_one: starting "cn=config"
56031cc7 config_back_db_open
56031cc7 config_build_entry: "cn=config"
56031cc7 config_build_entry: "cn=schema"
56031cc7 >>> dnNormalize: <cn={0}core>
56031cc7 <<< dnNormalize: <cn={0}core>
56031cc7 config_build_entry: "cn={0}core"
56031cc7 >>> dnNormalize: <cn={1}cosine>
56031cc7 <<< dnNormalize: <cn={1}cosine>
56031cc7 config_build_entry: "cn={1}cosine"
56031cc7 >>> dnNormalize: <cn={2}inetorgperson>
56031cc7 <<< dnNormalize: <cn={2}inetorgperson>
56031cc7 config_build_entry: "cn={2}inetorgperson"
56031cc7 >>> dnNormalize: <cn={3}nis>
56031cc7 <<< dnNormalize: <cn={3}nis>
56031cc7 config_build_entry: "cn={3}nis"
56031cc7 >>> dnNormalize: <cn={4}misc>
56031cc7 <<< dnNormalize: <cn={4}misc>
56031cc7 config_build_entry: "cn={4}misc"
56031cc7 config_build_entry: "olcDatabase={-1}frontend"
56031cc7 config_build_entry: "olcDatabase={0}config"
56031cc7 config_build_entry: "olcDatabase={1}hdb"
56031cc7 backend_startup_one: starting "dc=eme,dc=local"
56031cc7 hdb_db_open: warning - no DB_CONFIG file found in directory /var/lib/openldap-data: (2).
Expect poor performance for suffix "dc=eme,dc=local".
56031cc7 hdb_db_open: database "dc=eme,dc=local": dbenv_open(/var/lib/openldap-data).
56031cc7 hdb_db_open: database "dc=eme,dc=local": db_open(/var/lib/openldap-data/id2entry.bdb) failed: No such file or directory (2).
56031cc7 ====> bdb_cache_release_all
56031cc7 backend_startup_one (type=hdb, suffix="dc=eme,dc=local"): bi_db_open failed! (2)
slap_startup failed (test would succeed using the -u switch)
Back to top
View user's profile Send private message
kikko
Apprentice
Apprentice


Joined: 29 Apr 2014
Posts: 256
Location: Milan, IT

PostPosted: Thu Sep 24, 2015 8:20 am    Post subject: Reply with quote

Hi Wizumwalt
Wizumwalt wrote:
Code:
56031cc7 hdb_db_open: database "dc=eme,dc=local": db_open(/var/lib/openldap-data/id2entry.bdb) failed: No such file or directory (2).

Is there something in "/var/lib/openldap-data" ?

Regards
Back to top
View user's profile Send private message
Wizumwalt
Guru
Guru


Joined: 20 Aug 2006
Posts: 470

PostPosted: Mon Sep 28, 2015 11:04 pm    Post subject: Reply with quote

I have the following in that dir. Could it be corrupt? I have tried thins in the past. How would I re-init this db?
Code:

# cd /var/lib/openldap-data/
openldap-data # ls -l
total 836
-rw------- 1 ldap ldap    845 Sep 15 18:08 DB_CONFIG.example
-rw------- 1 ldap ldap  24576 Sep 23 16:42 __db.001
-rw------- 1 ldap ldap 114688 Sep 23 16:42 __db.002
-rw------- 1 ldap ldap 270336 Sep 23 16:42 __db.003
-rw------- 1 ldap ldap 163840 Sep 15 18:20 __db.004
-rw------- 1 ldap ldap 860160 Sep 23 16:42 __db.005
-rw------- 1 ldap ldap  32768 Sep 23 16:42 __db.006
-rw-r--r-- 1 ldap ldap   2048 Sep 23 16:42 alock
Back to top
View user's profile Send private message
kikko
Apprentice
Apprentice


Joined: 29 Apr 2014
Posts: 256
Location: Milan, IT

PostPosted: Tue Sep 29, 2015 7:42 am    Post subject: Reply with quote

Hi Wizumwalt
I'm not sure about what happened to your OpenLDAP, but it seems that newer versions store configurations in LDAP itself
you can follow this guide go get around your error: http://apfelboymchen.net/gnu/notes/openldap%20config%20backend.html
It looks like you have to start OpenLDAP with a proper slapd.conf file in order to get those initial files
Let me know

Regards
Back to top
View user's profile Send private message
Wizumwalt
Guru
Guru


Joined: 20 Aug 2006
Posts: 470

PostPosted: Thu Oct 01, 2015 12:58 am    Post subject: Reply with quote

I have OpenLDAP now running on the server. From what I'm understanding, the next step seems to be adding an ldap client to the hosts that I want to use with the server.

Can someone recommend one that works well w/ Gentoo, easy for a small number of people, commandline, no desktop.
Back to top
View user's profile Send private message
kikko
Apprentice
Apprentice


Joined: 29 Apr 2014
Posts: 256
Location: Milan, IT

PostPosted: Thu Oct 01, 2015 12:33 pm    Post subject: Reply with quote

Hi Wizumwalt
don't want to get into your business, but what are you trying to do? LDAP Centralized Authentication doesn't require specific client tools installed, AFAIK PAM module handles queries itself
https://wiki.gentoo.org/wiki/Centralized_authentication_using_OpenLDAP contains indications of what to merge for this purpose

On the other hand, if you need a CLI interface for other reasons, the only one that comes to my mind is the OpenLDAP "suite" of tools (ldapsearch for searches, ldapmodify for commits and so on... even Apache Directory Studio relies on these under the hood).
If you need it on Gentoo clients, you can emerge openldap with the "minimal" USE flag enabled

Regards
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum