OpenLDAPサーバーデーモンを起動できません

OpenLDAPサーバーデーモンを起動できません

Centos 7を使用してopenldapサーバーを設定するには、次の手順に従ってください。私はこの問題に直面しています

[root@linux1 ~]# systemctl restart slapd
Job for slapd.service failed because the control process exited with error code. See "systemctl status slapd.service" and "journalctl -xe" for details.
[root@linux1 ~]#
[root@linux1 ~]#
[root@linux1 ~]#
[root@linux1 ~]# systemctl status slapd
● slapd.service - OpenLDAP Server Daemon
   Loaded: loaded (/usr/lib/systemd/system/slapd.service; disabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Sun 2018-05-13 03:21:41 EDT; 7min ago
     Docs: man:slapd
           man:slapd-config
           man:slapd-hdb
           man:slapd-mdb
           file:///usr/share/doc/openldap-servers/guide.html
  Process: 2781 ExecStart=/usr/sbin/slapd -u ldap -h ${SLAPD_URLS} $SLAPD_OPTIONS (code=exited, status=1/FAILURE)
  Process: 2767 ExecStartPre=/usr/libexec/openldap/check-config.sh (code=exited, status=0/SUCCESS)

May 13 03:21:40 linux1.learnitguide.net runuser[2770]: pam_unix(runuser:session): session opened for user ldap by (uid=0)
May 13 03:21:40 linux1.learnitguide.net slapd[2781]: @(#) $OpenLDAP: slapd 2.4.44 (Apr 12 2018 19:17:38) $
                                                             [email protected]:/builddir/build/BUILD/openldap-2.4.44/openldap-2.4.44/servers/slapd
May 13 03:21:40 linux1.learnitguide.net slapd[2781]: ldif_read_file: checksum error on "/etc/openldap/slapd.d/cn=config/olcDatabase={1}monitor.ldif"
May 13 03:21:40 linux1.learnitguide.net slapd[2781]: ldif_read_file: checksum error on "/etc/openldap/slapd.d/cn=config/olcDatabase={2}hdb.ldif"
May 13 03:21:41 linux1.learnitguide.net slapd[2781]: tlsmc_cert_create_hash_symlink: ERROR: OS error: Permission denied
May 13 03:21:41 linux1.learnitguide.net slapd[2781]: Could not get the realpath: No such file or directory
May 13 03:21:41 linux1.learnitguide.net systemd[1]: slapd.service: control process exited, code=exited status=1
May 13 03:21:41 linux1.learnitguide.net systemd[1]: Failed to start OpenLDAP Server Daemon.
May 13 03:21:41 linux1.learnitguide.net systemd[1]: Unit slapd.service entered failed state.
May 13 03:21:41 linux1.learnitguide.net systemd[1]: slapd.service failed.
[root@linux1 ~]#

ベストアンサー1

「tlsmc_cert_create_hash_symlink:エラー:OSエラー:許可が拒否されました」問題はありませんが、「実際のパスを取得できませんでした。そのファイルまたはディレクトリがありません」という同じエラーメッセージが表示されます。

これはCentos7の最新のOpenldapバージョンに影響します。

rpm -qa | grep openldap                                                                                
    openldap-clients-2.4.44-13.el7.x86_64                                                                                                  
    openldap-servers-2.4.44-13.el7.x86_64                                                                     
    openldap-2.4.44-13.el7.x86_64

ls /var/lib/ldap/

ちなみに、このバージョンでは /var/lib/ldap の DB_CONFIG が空であるように見えます。理由が見つかりません。私自身のDB_CONFIGを作成してldap.confを変更しても問題は解決しませんでした。


あまりにも汚い解決策:OpenLdapをダウングレードしてください。

mkdir /tmp/openldap/
cd /tmp/openldap/
wget https://rpmfind.net/linux/centos/7.4.1708/os/x86_64/Packages/openldap-clients-2.4.44-5.el7.x86_64.rpm

wget https://www.rpmfind.net/linux/centos/7.4.1708/os/x86_64/Packages/openldap-2.4.44-5.el7.x86_64.rpm

wget https://rpmfind.net/linux/centos/7.4.1708/os/x86_64/Packages/openldap-servers-2.4.44-5.el7.x86_64.rpm

yum downgrade ./openldap-*
systemctl start slapd.service

申し訳ありません。他のバージョンはテストしていません。ソースに問題があります。ただし、LDAPはすぐに開始されます。

おすすめ記事