PDA

View Full Version : slapd wont start


projkt4
4th September 2004, 06:49 PM
hi all, i am trying to get my ldap service to start and i am getting a failure every time. i tried running:
su root -c /usr/local/libexec/slapd

and i get this error;
bash: line 1: /usr/local/libexec/slapd: No such file or directory

when i try running:
slapd -d -1

i get this:

@(#) $OpenLDAP: slapd 2.1.22 (Oct 23 2003 10:23:24) $
root@bugs.devel.redhat.com:/usr/src/build/319319-i386/BUILD/openldap-2.1.22/build-servers/servers/slapd
daemon_init: <null>
daemon_init: listen on ldap:///
daemon_init: 1 listeners to open...
ldap_url_parse_ext(ldap:///)
daemon: socket() failed errno=97 (Address family not supported by protocol)
daemon: initialized ldap:///
daemon_init: 2 listeners opened
slapd init: initiated server.
slap_sasl_init: initialized!
bdb_initialize: initialize BDB backend
bdb_initialize: Sleepycat Software: Berkeley DB 4.1.25: (December 19, 2002)
reading config file /etc/openldap/slapd.conf
line 4 (database bdb)
bdb_db_init: Initializing BDB database
line 5 (suffix "dc=klamathia,dc=org)
>>> dnPrettyNormal: <dc=klamathia,dc=org>
=> ldap_bv2dn(dc=klamathia,dc=org,0)
<= ldap_bv2dn(dc=klamathia,dc=org,0)=0
/etc/openldap/slapd.conf: line 5: suffix DN is invalid
slapd shutdown: freeing system resources.
slapd stopped.
connections_destroy: nothing to destroy.

so i check my slapd.conf:

# slapd.conf /etc/openldap/
#modified by projkt4 09.03.04

database bdb
suffix "dc=klamathia,dc=org
rootdn "cd=admin,dc=klamathia,dc=org"
rootpw secret
directory /admin/dbased/frontier.ldif


#end






so i can conclude that i am misdirecting slapd to the wrong directory. the openldap walkthrough says that i should be pointing the directory to
/usr/local/var/openldap-data

problem is i dont have a directory called /usr/local/var

what should i be putting in this line?


P.S.

i caught the missing quotes, but i still get the same error

corrected, but still broken;

database bdb
suffix "dc=klamathia,dc=org"
rootdn "cd=admin,dc=klamathia,dc=org"
rootpw secret
directory /admin/dbased/frontier.ldif



P.P.S.

in staring at that diognostic i feel more confident that it has to do with my line dealing with SUFFIX


suffix "dc=klamathia,dc=org"


now i am only parialy sure that i have this setup correctly, i have my host name as klamathia, so i am not sure if i need the ,dc=org because i dont have .org in the hostname. am i going in the right direction?

projkt4
5th September 2004, 05:41 AM
hi again, i decided to make a new post for this.

I decided to start over with the slapd.conf, heres the new, apparently working code!

#slapd.conf
#codename slapz
#projkt4 09.04.2004

#schemas to use
include /etc/openldap/schema/core.schema
include /etc/openldap/schema/cosine.schema
include /etc/openldap/schema/inetorgperson.schema
include /etc/openldap/schema/nis.schema


#logz ?
pidfile //var/run/slapd.pid
argsfile //var/run/slapd.args

########################################
##### dbm database definitions ####
########################################

database dbm
suffix "dc=frontier,dc=org"
rootdn "dc=admin.dc=frontier,dc="
rootpw secret

#database directory
directory /admin/dbased/openldap-data

#indisce to maintain


#end



so here i am with the service running, but i get this error if i search it:




[root@Klamathia ldap]# ldapsearch -x -b 'dc=frontier,cd=org' '(objectclass=*)'
# extended LDIF
#
# LDAPv3
# base <dc=frontier,cd=org> with scope sub
# filter: (objectclass=*)
# requesting: ALL
#

# search result
search: 2
result: 34 Invalid DN syntax
text: invalid DN

# numResponses: 1
[root@Klamathia ldap]# ldapsearch -x -b 'dc=frontier,cd=org' '(objectclass=*)'
# extended LDIF
#
# LDAPv3
# base <dc=frontier,cd=org> with scope sub
# filter: (objectclass=*)
# requesting: ALL
#

# search result
search: 2
result: 34 Invalid DN syntax
text: invalid DN

# numResponses: 1



why do i keep getting this "invalid DN syntax"? what is this DN anyway?

projkt4
5th September 2004, 05:51 AM
ok, figgured out that that problem with the DN can be solved later my issue is when i run:

slapd -d -1

i get this response:


[root@Klamathia schema]# slapd -d -1
@(#) $OpenLDAP: slapd 2.1.22 (Oct 23 2003 10:23:24) $
root@bugs.devel.redhat.com:/usr/src/build/319319-i386/BUILD/openldap-2.1.22/build-servers/servers/slapd
daemon_init: <null>
daemon_init: listen on ldap:///
daemon_init: 1 listeners to open...
ldap_url_parse_ext(ldap:///)
daemon: socket() failed errno=97 (Address family not supported by protocol)
daemon: bind(6) failed errno=98 (Address already in use)
slap_open_listener: failed on ldap:///
slapd stopped.
connections_destroy: nothing to destroy.



now im starting to get lost, what file should i be looking at so that i may find the problimatic lines?

dave_kimberley
5th September 2004, 10:31 AM
The problem with the LDAP search is that you have made a typo:

ldapsearch -x -b 'dc=frontier,cd=org' '(objectclass=*)'

Sould be replaced with

ldapsearch -x -b 'dc=frontier,dc=org' '(objectclass=*)'

Try that, and let me know the responce.

projkt4
5th September 2004, 11:56 AM
when i run your corrected line i get:


[root@Klamathia root]# ldapsearch -x -b 'dc=frontier,dc=org' '(objectclass=*)'
# extended LDIF
#
# LDAPv3
# base <dc=frontier,dc=org> with scope sub
# filter: (objectclass=*)
# requesting: ALL
#

# search result
search: 2
result: 32 No such object

# numResponses: 1



i think this is what i should be seeing, and i need to add a user now, but i cant ldapadd. i keep getting

ldap_bind: Invalid credentials (49)

i am currently trying to figgure out why it wont authenticate, i have the password in plaintext right now. im gonna go sleep on it for a few hours, let me know if you think of anything. thanks for the help.

dave_kimberley
5th September 2004, 01:32 PM
Thats the correct responce.

With regards to ldapadd firstly create a LDIF file that looks something like:

dn: cn=Dave,ou=people,dc=rontier,dc=org
cn: Dave
objectclass: top
objectclass: person
objectclass: account
objectclass: organizationalPerson
objectclass: inetOrgPerson
objectclass: posixAccount
mail: dave@dave.com
roomnumber:
homephone:
givenname: Dave
sn: Kimberley
uid: dkimberley
userpassword: {crypt}*
loginshell: /bin/csh
uidnumber: 416
gidnumber: 10
homedirectory: /home/dkimberley


Save this file as myldif.ldif for example, then run the below command:

ldapadd -D -x "cn=Manager, dc=rontier, dc=org" -W < myldif.ldif

You should then be prompted for the Manager password. This will populate the directory using the LDIF file.

Then to check this has worked try the ldapsearch again:

ldapsearch -L -b "dc=rontier, dc=org" -W "(objectclass=*)"

projkt4
6th September 2004, 08:56 AM
silly question but where should my .ldif file reisde?

dave_kimberley
6th September 2004, 09:06 AM
The ldif file can reside anywhere, create the file in /tmp then run:

ldapadd -D -x "cn=Manager, dc=rontier, dc=org" -W < /tmp/myldif.ldif

Tokar Travel Photos - Grevenbroich - Shizilu Instagram Photos