LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-13-2005, 10:59 AM   #1
cboxall
LQ Newbie
 
Registered: Jun 2005
Location: Baltimore, MD
Distribution: Suse Enterprise Server 9.0
Posts: 7

Rep: Reputation: 0
Post Problem importing LDIF file into OpenLDAP database




Intro and background: I’m running OpenLDAP 2.26 on a Suse Enterprise Server 9.0. I’m trying to use the OpenLDAP database to make a portion of Active Directory (just usernames, universal group memberships and email addresses) available to a segment of the DMZ that can’t be allowed access to the entire Active Directory infrastructure. To do this, the AD folks are going to provide me a daily LDIF (via a batch process) of all the user objects with just the attributes I need values for. For security reasons, we can’t use more typical replication techniques. I need to then use a batch process to import those LDIF files into the OpenLDAP database. I have run into a variety of problems linked to the facts that a) I’ve never used OpenLDAP before, and b) I’ve never used Linux before. I’ve managed to get Suse installed and OpenLDAP running, so I don’t think the situation is completely hopeless.



The problem I’m bringing up for discussion here is that when I try to import an LDIF file, it fails if any of the entries in LDIF file already exist in the LDAP database. From reading over the archives, the best solution appears to be to kill the slapd process, delete the database files, restart the slapd process and then import the LDIF file to rebuild the database. I think this is a lovely solution, since it also will delete accounts that don’t exist in AD anymore. The trouble is: how do I kill the slapd process in a batch process? I don’t know how to write batch files or their equivalent on Linux yet, but I imagine part of it will be figuring out what commands need to be executed, and since kill seems to require a process ID that changes over time, I’m not sure how to proceed. Is there functionality with OpenLDAP to shut down slapd that I don’t know about, or how should I do this?

If there are some specific background matierals I should read, please point me to them. Thanx!
 
Old 06-17-2005, 09:51 AM   #2
cboxall
LQ Newbie
 
Registered: Jun 2005
Location: Baltimore, MD
Distribution: Suse Enterprise Server 9.0
Posts: 7

Original Poster
Rep: Reputation: 0
I got help over in the OpenLDAP forum. I just needed to use -

# Stop the OpenLDAP database
/etc/init.d/ldap stop

# Delete the OpenLDAP database files, which are stored, in this case
# in /data/duckpond.dol
rm /data/duckpond.dol/*

# Start the OpenLDAP database
/etc/init.d/ldap start

# Import the LDIF file containing the information for the
# OpenLDAP database
/usr/sbin/slapadd -l /data/openldaptemp/dump.ldif

I'm all set, thanx anyway!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
openldap: no secret in database Finlay Linux - Software 8 02-13-2009 09:49 PM
Problem importing database back to MySql shubb Programming 3 11-29-2005 01:36 PM
openldap ldif file problem iluvatar Linux - Software 3 07-31-2005 06:57 PM
New to Open LDAP. Trying to import an LDIF file. davealex Linux - Networking 1 10-16-2003 03:19 PM
MySQL: Importing a database from an XML file concoran General 0 09-08-2003 02:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

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