Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

My PDC using Samba 3.6 with LDAP (the latest version) works very fine as long as I use hdb as the backend. Nevertheless, I change the backend to sql I receive the following error while trying to restart the slapd daemon:

Segmentation fault

I also receive nothing when I run slaptest on slapd.conf neither success nor failure.

My server is Ubuntu 12.4 LTS and I have also tested the PostgreSQL installation and it works fine. Does anyone have any idea? What Segmentation fault mean exactly?

Here is my slapd.conf:

# This is the main slapd configuration file. See slapd.conf(5) for more
# info on the configuration options.

#######################################################################
# Global Directives:

# Features to permit
#allow bind_v2

# Schema and objectClass definitions
include         /etc/ldap/schema/core.schema
include         /etc/ldap/schema/cosine.schema
include         /etc/ldap/schema/nis.schema
include         /etc/ldap/schema/inetorgperson.schema
include         /etc/ldap/schema/samba.schema
include         /etc/ldap/schema/misc.schema


# Where the pid file is put. The init.d script
# will not stop the server if you change this.
pidfile         /var/run/slapd/slapd.pid

# List of arguments that were passed to the server
argsfile        /var/run/slapd/slapd.args

# Read slapd.conf(5) for possible values
loglevel        none

# Where the dynamically loaded modules are stored
modulepath    /usr/lib/ldap
moduleload    back_hdb
moduleload    back_sql

# The maximum number of entries that is returned for a search operation
sizelimit 500

# The tool-threads parameter sets the actual amount of cpu's that is used
# for indexing.
tool-threads 1

#######################################################################
# Specific Backend Directives for @BACKEND@:
# Backend specific directives apply to this backend until another
# 'backend' directive occurs
backend        sql
#######################################################################

# Specific Directives for database #1, of type @BACKEND@:
# Database specific directives apply to this databasse until another
# 'database' directive occurs
database        sql

# The base of your directory in database #1
suffix          "dc=example,dc=local"

# rootdn directive for specifying a superuser on the database. This is needed
# for syncrepl.
rootdn          "cn=admin,dc=example,dc=local"
rootpw        secret
dbname        PgSQL
dbuser        test
dbpasswd    test
insentry_stmt    "insert into ldap_entries (id,dn,oc_map_id,parent,keyval) values ((select max(id)+1 from ldap_entries),?,?,?,?)"
upper_func    "upper"
strcast_func    "text"
concat_pattern    "?||?"
has_ldapinfo_dn_ru    no

schemacheck    on

lastmod off

# The userPassword by default can be changed
# by the entry owning it if they are authenticated.
# Others should not be able to see it, except the
# admin entry below
# These access lines apply to database #1 only
access to attrs=userPassword,sambaNTPassword,sambaLMPassword
        by dn="cn=admin,dc=example,dc=local" write
        by anonymous auth
        by self write
        by * none

# Ensure read access to the base for things like
# supportedSASLMechanisms.  Without this you may
# have problems with SASL not knowing what
# mechanisms are available and the like.
# Note that this is covered by the 'access to *'
# ACL below too but if you change that as people
# are wont to do you'll still need this if you
# want SASL (and possible other things) to work 
# happily.
access to dn.base="" by * read

# The admin dn has full write access, everyone else
# can read everything.
access to *
        by dn="cn=admin,dc=example,dc=local" write
        by * read

This is the error I foind using strace slapd:

reza@pdc2:-$ sudo strace slapd
open("/home/reza/.odbcinst.ini", O_RDONLY)     = -1 EACCES (Permission denied)


reza@pdc2:-$ls -l /home/reza/.odbcinst.ini
-rw-r--r-- 1 root root 473 April 24 15:51 /home/reza/.odbcinst.ini
share|improve this question
    
where do you get that slapd.conf file? My 12.04 installation do not have that file, and FYI, ldap is now use slapd-config backend, you will change you config with ldapmodify, not manually change text file. You should change loglevel to 256 or 16383 to get more information about error (in /var/log/syslog) –  HVNSweeting Apr 23 '13 at 15:21
    
I reinstalled PostgreSQL and I don't get any longer that error. Nevertheless, slaptest doesn't return anything yet and restart of slapd still fails. Slapd works fine with hdb so I am quite sure that the problem comes from PostgreSQL as the slapd.conf I have used is the example provided by OpenLDAP website itself for a PostgreSQL backend. If it is working for you on Ubuntu 12.4, can you tell me if you had the driver "" on your OS after PostgreSQL ODBC installation? –  alibaba Apr 24 '13 at 7:35
    
I reinstalled PostgreSQL and I don't get any longer that error. Nevertheless, slaptest doesn't return anything yet and restart of slapd still fails. Slapd works fine with hdb so I am quite sure that the problem comes from PostgreSQL as the slapd.conf I have used is the example provided by OpenLDAP website itself for a PostgreSQL backend. If it is working for you on Ubuntu 12.4, can you tell me if you had the driver "/usr/local/lib/psqlodbcw.so" on your OS after PostgreSQL ODBC installation? –  alibaba Apr 24 '13 at 7:42
    
I also have another question: As Samba has an LDAP schema, do I need to create tables manually in SQL backend or LDAP will just use the backend to save its entries (just install PostgreSQL and integrate it with LDAP)? My questions may seem very naïve but I am a beginner :) –  alibaba Apr 24 '13 at 7:50
    
I don't use postgresql as backend of LDAP, so I don't know that problem. But you can update here your errors when your slapd failed. For postgres as backend, you can check this tut darold.net/projects/ldap_pg/HOWTO –  HVNSweeting Apr 24 '13 at 12:02

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.