LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   install openldap berkley version errors (https://www.linuxquestions.org/questions/linux-newbie-8/install-openldap-berkley-version-errors-920859/)

bathory 12-29-2011 11:38 AM

You need to populate your directory. See this for an explanation
While slapd is not running use slapadd to add the ldif containing the base dn(s)

fwellers 12-29-2011 01:15 PM

Quote:

Originally Posted by bathory (Post 4561078)
You need to populate your directory. See this for an explanation
While slapd is not running use slapadd to add the ldif containing the base dn(s)

Ok,
So I put an ldif file in the current directory ( same directory where the slapd.conf is ), and I ran this:

./slapadd -l /usr/openldap-2.4.28/servers/slapd/s18.ldif -f slapd.conf -d -1

I get the same basic error, which is this:
4efcbbf3 slapadd startup: initiated.
4efcbbf3 backend_startup_one: starting "o=meteorregistry.com"
4efcbbf3 bdb_db_open: "o=meteorregistry.com"
4efcbbf3 bdb_db_open: database "o=meteorregistry.com": dbenv_open(/usr/openldap-2.4.28/servers/slapd/openldap-data).
4efcbbf3 bdb_db_open: database "o=meteorregistry.com": db_open(/usr/openldap-2.4.28/servers/slapd/openldap-data/id2entry.bdb) failed: No such file or directory (2).
4efcbbf3 ====> bdb_cache_release_all
4efcbbf3 backend_startup_one (type=bdb, suffix="o=meteorregistry.com"): bi_db_open failed! (2)
slap_startup failed


Thanks !!
Floyd

bathory 12-29-2011 02:05 PM

What's in s18.ldif? If there are some sensitive data, you may mask it.

Since you're migrating from another ldap server, you should export the correct ldif from it, and import the same in openldap with slapadd. You can delete everything (except DB_CONFIG) from /usr/openldap-2.4.28/servers/slapd/openldap-data before running slapadd again
I guess it's not a permissions problem, as slapd can write in /usr/openldap-2.4.28/servers/slapd/openldap-data its logs and transaction data, but anyway check the permissions of that directory. Also, I don't know if oracle linux uses selinux, so check if that's the case.

fwellers 12-30-2011 05:58 AM

1 Attachment(s)
Quote:

Originally Posted by bathory (Post 4561197)
What's in s18.ldif? If there are some sensitive data, you may mask it.

Since you're migrating from another ldap server, you should export the correct ldif from it, and import the same in openldap with slapadd. You can delete everything (except DB_CONFIG) from /usr/openldap-2.4.28/servers/slapd/openldap-data before running slapadd again
I guess it's not a permissions problem, as slapd can write in /usr/openldap-2.4.28/servers/slapd/openldap-data its logs and transaction data, but anyway check the permissions of that directory. Also, I don't know if oracle linux uses selinux, so check if that's the case.

Thank you.
I deleted all the files in the openldap-data directory except the logs directory and the DB_CONFIG. ( done this before too )
I ran this:
slapadd -b "o=meteorregistry.com" -v -l s18.ldif

I got back the same.
[root@prod-meteor1v4 slapd]# ./slapadd -b "o=meteorregistry.com" -v -l s18.ldif
4efda633 bdb_db_open: database "o=meteorregistry.com": db_open(/usr/openldap-2.4.28/servers/slapd/openldap-data/id2entry.bdb) failed: No such file or directory (2).
4efda633 backend_startup_one (type=bdb, suffix="o=meteorregistry.com"): bi_db_open failed! (2)
slap_startup failed

Our ldif file is really open to all so it's ok. I just took the liberty of snipping out the encrypted ssl certs in there, and I cut out a lot of the file because it's just more of the same. It's attached.

Permissions aren't a problem because right now everything is done by root.

Thank you !
Floyd

bathory 12-30-2011 07:19 AM

Quote:

Permissions aren't a problem because right now everything is done by root.
Did you check if it's selinux? If selinux is enabled, a process cannot write in some directories even if run as root, if there is no such permission by selinux
FYI I've tried your ldif and the 1st dn was imported successfully. The rest was rejected because of invalid dn

fwellers 12-30-2011 07:24 AM

Quote:

Originally Posted by bathory (Post 4561683)
Did you check if it's selinux? If selinux is enabled, a process cannot write in some directories even if run as root, if there is no such permission by selinux
FYI I've tried your ldif and the 1st dn was imported successfully. The rest was rejected because of invalid dn

I don't know what selinux is or how to check for it. We have Oracle's version of Red Hat unbreakable linux. Is there something I can check ?

I would imagine that maybe the reason the ldif doesn't work for you is because you need the special schema ?

bathory 12-30-2011 07:39 AM

Quote:

I don't know what selinux is or how to check for it. We have Oracle's version of Red Hat unbreakable linux. Is there something I can check
You can run
Code:

sestatus
to check if that's the case

Quote:

I would imagine that maybe the reason the ldif doesn't work for you is because you need the special schema ?
Yeah, I'm missing some objectclasses, but I tried to import the ldif just to see what happens. The id2entry.bdb and the other dbs was created as they should.

fwellers 12-30-2011 07:45 AM

Quote:

Originally Posted by bathory (Post 4561693)
You can run
Code:

sestatus
to check if that's the case

Yeah, I'm missing some objectclasses, but I tried to import the ldif just to see what happens. The id2entry.bdb and the other dbs was created as they should.

Thanks.
So selinux is disabled. I guess that means no permission problems right ?

bathory 12-30-2011 08:38 AM

1 Attachment(s)
Yup it's disabled. I cannot think of anything else that does not allow writing!
Try to use a different directory to store the data. You can use the attached slapd.conf (adjust the schemas location) and create the /tmp/data directory to store the database.
It's the one I've used to test your ldif.

fwellers 12-30-2011 08:54 AM

Quote:

Originally Posted by bathory (Post 4561731)
Yup it's disabled. I cannot think of anything else that does not allow writing!
Try to use a different directory to store the data. You can use the attached slapd.conf (adjust the schemas location) and create the /tmp/data directory to store the database.
It's the one I've used to test your ldif.

That seems to work, thank you !!

I run this to start it:
./slapd -f ./slapd-linux.conf -d -1

and I run this to kill it.
kill -INT `cat /usr/local/var/run/slapd.pid`

Now I will try and get it running with the script you gave me.

Thanks again Bathory !!

fwellers 12-30-2011 09:31 AM

Quote:

Originally Posted by bathory (Post 4561731)
Yup it's disabled. I cannot think of anything else that does not allow writing!
Try to use a different directory to store the data. You can use the attached slapd.conf (adjust the schemas location) and create the /tmp/data directory to store the database.
It's the one I've used to test your ldif.

So I am not able to start it with your script. The only thing I changed in your script was the LD_LIBRARY_PATH.
It just exits and says it can't start ldap.

But I can start it with this little script.
#!/bin/ksh

if [ $1 = "start" ]
then
cd /usr/openldap-2.4.28/servers/slapd
nohup /usr/local/libexec/slapd -f ./slapd-linux.conf &
fi
if [ $1 = "stop" ]
then
kill -INT `cat /usr/local/var/run/slapd.pid`
fi


Any idea why ?

Also I have a question.
In your slapd.conf file you have these:
suffix "o=meteorregistry.com"
rootdn "cn=Manager,o=meteorregistry.com"

I would like to change the rootdn to match what we have in our ldif which is this:
rootdn "cn=nslcadmin,o=meteorregistry.com"

Will that mess up the database if I do that ??

Thanks again !!

Floyd

bathory 12-30-2011 10:42 AM

Quote:

So I am not able to start it with your script. The only thing I changed in your script was the LD_LIBRARY_PATH.
It just exits and says it can't start ldap.
First of all the script is not mine. Credits go to the person mentioned in the very first lines of it. Maybe it's because of the pid file being in a different place


Quote:

I would like to change the rootdn to match what we have in our ldif which is this:
rootdn "cn=nslcadmin,o=meteorregistry.com"

Will that mess up the database if I do that ??
No.
The rootdn is used when you have to run some ldap tools that need authentication (like ldapadd). Usually it's not even present in the database.

Regards

fwellers 12-30-2011 10:54 AM

Quote:

Originally Posted by bathory (Post 4561830)
First of all the script is not mine. Credits go to the person mentioned in the very first lines of it. Maybe it's because of the pid file being in a different place

Sorry about that. Didn't want to insinuate anything. :-) Yea it's not the pid file location, I changed that. NO biggy.



Quote:

No.
The rootdn is used when you have to run some ldap tools that need authentication (like ldapadd). Usually it's not even present in the database.

Regards
Thanks Bathory !!
You really stuck with me, and I appreciate it.
Of course this is just the beginning. <grin>

fwellers 01-04-2012 08:43 AM

I am going to mark this as solved.

the reason I couldn't get the id2entry.bdb database made was that I needed to make a directory called "db" in the database directory.
It was being pointed to by the DB_CONFIG file.

After that, I was able to import my ldif with slapadd -l [ldif file]

Thanks for all your help !!!!!


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