On Thu, Apr 20, 2006 at 11:56:00AM +0100, Ken Guest wrote:
> I've had to try and restart ldap on a server in work (after rebuilding index files).
> I chowned/chgrped the generated files for access by the ldap owner and group;
> as a part of this prescribed process:
>> cd /var/db/
> cp -R openldap-data openldap-data-bk-200600420
> cd openldap-data
> rm *
> cp ../openldap-data-bk-200600420/id2entry.bdb .
> slapindex
> chown ldap.ldap /var/db/openldap-data/*
>>> Starting the slapd service gets the following dumped into the log file:
>> Apr 20 11:44:25 XXXXX slapd[20819]: bdb_initialize: Sleepycat Software: Berkeley DB 4.1.25: (December 19, 2002)
> Apr 20 11:44:25 XXXXX slapd[20819]: bdb_db_init: Initializing BDB database
> Apr 20 11:44:25 XXXXX slapd[20820]: bdb(dc=XXXXX,dc=YYY,dc=ZZZ): /var/db/openldap-data/__db.001: Permission denied
> Apr 20 11:44:25 XXXXX slapd[20820]: bdb_db_open: dbenv_open failed: Permission denied (13)
> Apr 20 11:44:25 XXXXX slapd[20820]: backend_startup: bi_db_open(0) failed! (13)
> Apr 20 11:44:25 XXXXX slapd[20820]: bdb(dc=XXXXX,dc=YYY,dc=ZZZ): txn_checkpoint interface requires an environment configured for the transaction subsystem
> Apr 20 11:44:25 XXXXX slapd[20820]: bdb_db_destroy: txn_checkpoint failed: Invalid argument (22)
> Apr 20 11:44:25 XXXXX slapd[20820]: slapd stopped.
> Apr 20 11:44:25 XXXXX slapd[20820]: connections_destroy: nothing to destroy.
>> (some details are masked out)
>> what must I do to get the ldap server up and running again?
*manages to look suitably embarrassed*
ANSWER:
permissions on the files were set ok, but not on the directory they're in :-D
I checked details against /usr/local/etc/rc.d/slapd.sh to be sure what the user
and group details should be on the off-chance they had been changed from the
default.
Process for restoring the corrupt openLDAP database should be:
cd /var/db/
cp -R openldap-data openldap-data-bk-200600420
cd openldap-data
rm *
cp ../openldap-data-bk-200600420/id2entry.bdb .
slapindex
chown -R ldap.ldap /var/db/openldap-data
k.
--
Ken Guest
Irish Linux Users' Group webmaster, www.linux.ie
Mobile: +353 86 8252 141
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!