2011年3月30日

openldap backend_startup_one: bi_db_open failed! (-1)

啟動 openldap 時出現
bdb_db_open: alock package is unstable
backend_startup_one: bi_db_open failed! (-1)
slap_startup failed (test would succeed using the -u switch)


這通常是權限及alock的問題,要判斷哪種問題,首先將slapd.conf的loglevel
調整成1

shell># vim /etc/openldap/slapd.conf
loglevel 1
shell># service ldap restart
一些原本看不到的訊息就出現了
/var/lib/ldap/__db.003 is not owned by "ldap" [警告]
/var/lib/ldap/__db.002 is not owned by "ldap" [警告]
/var/lib/ldap/__db.004 is not owned by "ldap" [警告]
/var/lib/ldap/__db.001 is not owned by "ldap" [警告]
/var/lib/ldap/__db.006 is not owned by "ldap" [警告]
/var/lib/ldap/__db.005 is not owned by "ldap" [警告]
正在為 slapd 檢查設定檔案: bdb_db_open: alock package is unstable
backend_startup_one: bi_db_open failed! (-1)
slap_startup failed (test would succeed using the -u switch)

像上述的問題只要調整權限就可解決,若是alock的問題,參考slapd.conf裡的directory參數找到資料庫位置,然後把alock刪除即可。另外selinux也可能造成這樣的問題,你可以先setenforce 0測試是否為selinux造成

沒有留言:

張貼留言