LinuxQuestions.org
Support LQ: Use code LQCO20 and save 20% on CrossOver Office
Go Back   LinuxQuestions.org > Forums > Linux > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Tags used in this thread
Popular LQ Tags ,

Reply
 
Thread Tools
Old 07-02-2009, 09:03 AM   #1
nhay
Member
 
Registered: Jul 2009
Location: Durham, NH
Distribution: Fedora
Posts: 51
Thanked: 0
Problem with my ldap schema


[Log in to get rid of this advertisement]
Hi,

LDAP works fine for me with the schemas provided, but for simplicity's sake I created a custom schema to fit my particular needs.

I created the following schema in the /usr/local/etc/openldap/schema directory:

#####################################################################
# employee.schema -- Employee
# Basic schema to handle only necessary attributes and classes

# name
# This is the common name of an individual, ex: John Doe
attributetype ( 1.1.2.1.1
NAME 'name'
DESC 'common name'
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )

# email
# This is the individual's email address
attributetype ( 1.1.2.1.2
NAME 'email'
DESC 'primary email'
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )

# office
# This is the room number of the individual's office
attributetype ( 1.1.2.1.3
NAME 'office'
DESC 'office room number'
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )

# officePhone
# This is the office telephone number
attributetype ( 1.1.2.1.4
NAME 'officePhone'
DESC 'office phone number'
EQUALITY telephoneNumberMatch
SUBSTR telephoneNumberSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.50{32} )

# cellPhone
# Individual's cell number if necessary or applicable
attributetype ( 1.1.2.1.5
NAME 'cellPhone'
DESC 'cell phone number'
EQUALITY telephoneNumberMatch
SUBSTR telephoneNumberSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.50{32} )

# employee
# All personnel of eos
objectclass ( 1.1.2.2.3
NAME 'employee'
SUP top
STRUCTURAL
MUST ( name $ email )
MAY ( office $ officePhone $ cellPhone )
)
#####################################################################

I added the following line to the slapd.conf file:

include /usr/local/etc/openldap/schema/employee.schema

Here is my ldif file:

#####################################################################
dn: cn=test,dc=ldap,dc=sr,dc=unh,dc=edu
name: John Doe
email: jdoe @ example.com
office: Hull 338
officephone: 555 5555
cellphone: 123 1234
objectclass: employee
#####################################################################

When I run ldapadd I get this:

ldap_add: Undefined attribute type (17)
additional info: office: attribute type undefined

If I comment out that particular attribute then I get the same message for officephone and cellphone as well.

I'm completely at a loss. Any help would be greatly appreciated. Thanks in advance.
nhay is offline  
Tag This Post ,
Reply With Quote
Old 07-02-2009, 09:12 AM   #2
nowonmai
Member
 
Registered: Jun 2003
Posts: 380
Thanked: 17
At the risk of asking the obvious... did you restart slapd?
nowonmai is offline     Reply With Quote
Old 07-02-2009, 09:17 AM   #3
nhay
Member
 
Registered: Jul 2009
Location: Durham, NH
Distribution: Fedora
Posts: 51
Thanked: 0

Original Poster
I seemed to have issues doing that. I tried /etc/rc.d/init.d/slapd restart but slapd doesn't seem to be in that directory for some reason. I'm sure there must be some other way to restart it. Any ideas?
nhay is offline     Reply With Quote
Old 07-02-2009, 09:47 AM   #4
nowonmai
Member
 
Registered: Jun 2003
Posts: 380
Thanked: 17
In many cases, though the server is called slapd, the actual service command is ldap, so you could try /etc/init.d/ldap restart or service ldap restart
nowonmai is offline     Reply With Quote
Old 07-02-2009, 09:52 AM   #5
nhay
Member
 
Registered: Jul 2009
Location: Durham, NH
Distribution: Fedora
Posts: 51
Thanked: 0

Original Poster
Thanks. I gave both of those a try and they both give me this:

Stopping slapd: [FAILED]
Starting slapd: [FAILED]

:-(
nhay is offline     Reply With Quote
Old 07-02-2009, 10:03 AM   #6
nowonmai
Member
 
Registered: Jun 2003
Posts: 380
Thanked: 17
OK, if you try sudo cat /var/log/messages | grep slapd it should tell you why.
Since the daemon is not running, a start will do instead of a restart
nowonmai is offline     Reply With Quote
Old 07-02-2009, 10:08 AM   #7
nhay
Member
 
Registered: Jul 2009
Location: Durham, NH
Distribution: Fedora
Posts: 51
Thanked: 0

Original Poster
grep returns nothing about slapd in messages. Trying a simple /etc/init.d/ldap start or service ldap start still fails to start slapd.
nhay is offline     Reply With Quote
Old 07-02-2009, 10:38 AM   #8
nhay
Member
 
Registered: Jul 2009
Location: Durham, NH
Distribution: Fedora
Posts: 51
Thanked: 0

Original Poster
So it looks like my biggest issue right now is that I can't get slapd to restart (or start apparently). Anyone have any suggestions?
nhay is offline     Reply With Quote
Old 07-02-2009, 12:05 PM   #9
nowonmai
Member
 
Registered: Jun 2003
Posts: 380
Thanked: 17
In /etc/openldap/slapd.conf, set loglevel to 256
Then, in a terminal, run sudo tail -f /var/log/messages
In another terminal run sudo service ldap start and switch back to the other term to see the messages.
nowonmai is offline     Reply With Quote
Old 07-02-2009, 01:20 PM   #10
nhay
Member
 
Registered: Jul 2009
Location: Durham, NH
Distribution: Fedora
Posts: 51
Thanked: 0

Original Poster
I see a slapd.conf in /etc/openldap/ but I've been editing the one in /usr/local/etc/openldap/. Is that bad? When I add the line loglevel = 256 to that file and tail the logs and run /sbin/service ldap start nothing shows in the logs but I now get this message:

Checking configuration files for slapd: [FAILED]
could not stat config file "/etc/openldap/schema/employee.schema": No such file or directory (2)
slaptest: bad configuration file!
nhay is offline     Reply With Quote
Old 07-02-2009, 01:59 PM   #11
nhay
Member
 
Registered: Jul 2009
Location: Durham, NH
Distribution: Fedora
Posts: 51
Thanked: 0

Original Poster
I moved everything over to /etc/openldap/ and edited that slapd.conf file. Now when I try to restart slapd I get this error:

/etc/openldap/slapd.conf: line 90: <suffix> invalid DN 21 (Invalid syntax)
slaptest: bad configuration file!

I checked my slapd.conf and my suffix is the same as it was before in my other conf file. I don't know what's wrong. This is starting to drive me crazy!
nhay is offline     Reply With Quote
Old 07-03-2009, 04:23 AM   #12
nowonmai
Member
 
Registered: Jun 2003
Posts: 380
Thanked: 17
Can you attach the file?
nowonmai is offline     Reply With Quote
Old 07-03-2009, 08:37 PM   #13
nhay
Member
 
Registered: Jul 2009
Location: Durham, NH
Distribution: Fedora
Posts: 51
Thanked: 0

Original Poster
Here's my slapd.conf
Attached Files
File Type: txt slapd.txt (4.5 KB, 1 views)
nhay is offline     Reply With Quote

Reply

Bookmarks


Thread Tools

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
RHEL 4 Ldap schema ciphyre Red Hat 0 09-24-2008 01:45 AM
Creating my own schema in LDAP gokulnath Linux - Networking 8 09-26-2006 12:12 AM
LDAP rfc2307bis.schema automount Bikerpete Linux - Networking 0 01-08-2006 06:10 AM
Ldap schema error mesh2005 Linux - Networking 0 11-20-2005 05:16 AM
LDAP schema for proxy server Niceman2005 Linux - Networking 0 01-23-2005 08:58 PM


All times are GMT -5. The time now is 01:01 AM.

Main Menu
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
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration