主题: openldap 無法啟動
CentOS 7 ,更新版本為kernel-3.10.0-862.el7.x86_64 後 , slapd 無法啟動.
# systemctl status slapd.service -l
● slapd.service - OpenLDAP Server Daemon
Loaded: loaded (/usr/lib/systemd/system/slapd.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since 四 2018-05-10 19:06:02 CST; 1h 53min ago
Docs: man:slapd
man:slapd-config
man:slapd-hdb
man:slapd-mdb
file:///usr/share/doc/openldap-servers/guide.html
Process: 4007 ExecStart=/usr/sbin/slapd -u ldap -h ${SLAPD_URLS} $SLAPD_OPTIONS (code=exited, status=1/FAILURE)
Process: 3998 ExecStartPre=/usr/libexec/openldap/check-config.sh (code=exited, status=0/SUCCESS)
5月 10 19:06:02 mail.mydomain.com runuser[4001]: pam_unix(runuser:session): session opened for user ldap by (uid=0)
5月 10 19:06:02 mail.mydomain.com runuser[4001]: pam_unix(runuser:session): session closed for user ldap
5月 10 19:06:02 mail.mydomain.com slapd[4007]: @(#) $OpenLDAP: slapd 2.4.44 (Apr 12 2018 19:17:38) $
mockbuild@x86-01.bsys.centos.org:/builddir/build/BUILD/openldap-2.4.44/openldap-2.4.44/servers/slapd
5月 10 19:06:02 mail.mydomain.com slapd[4007]: main: TLS init def ctx failed: -1
5月 10 19:06:02 mail.mydomain.com slapd[4007]: slapd stopped.
5月 10 19:06:02 mail.mydomain.com slapd[4007]: connections_destroy: nothing to destroy.
5月 10 19:06:02 mail.mydomain.com systemd[1]: slapd.service: control process exited, code=exited status=1
5月 10 19:06:02 mail.mydomain.com systemd[1]: Failed to start OpenLDAP Server Daemon.
5月 10 19:06:02 mail.mydomain.com systemd[1]: Unit slapd.service entered failed state.
5月 10 19:06:02 mail.mydomain.com systemd[1]: slapd.service failed.
/var/log/openldap.log
May 10 18:24:09 mail slapd[19840]: @(#) $OpenLDAP: slapd 2.4.44 (Apr 12 2018 19:17:38) $#012#011mockbuild@x86-01.bsys.centos.org:/builddir/build/BUILD/openld44/openldap-2.4.44/servers/slapd
May 10 18:24:09 mail slapd[19840]: slapd starting
May 10 18:24:11 mail slapd[19840]: conn=1000 fd=8 ACCEPT from PATH=/tmp/tmp.8ODsyGsYuv/socket (PATH=/tmp/tmp.8ODsyGsYuv/socket)
May 10 18:24:11 mail slapd[19840]: conn=1000 op=0 BIND dn="" method=163
May 10 18:24:11 mail slapd[19840]: conn=1000 op=0 BIND authcid="gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth" authzid="gidNumber=0+uidNumber=0,cn=d,cn=external,cn=auth"
May 10 18:24:11 mail slapd[19840]: conn=1000 op=0 BIND dn="gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth" mech=EXTERNAL sasl_ssf=0 ssf=71
May 10 18:24:11 mail slapd[19840]: conn=1000 op=0 RESULT tag=97 err=0 text=
May 10 18:24:11 mail slapd[19840]: conn=1000 op=1 ADD dn="cn=temporary"
May 10 18:24:11 mail slapd[19840]: conn=1000 op=1 RESULT tag=105 err=0 text=
May 10 18:24:11 mail slapd[19840]: conn=1000 op=2 UNBIND
May 10 18:24:11 mail slapd[19840]: conn=1000 fd=8 closed
May 10 18:24:11 mail slapd[19840]: conn=1001 fd=8 ACCEPT from PATH=/tmp/tmp.8ODsyGsYuv/socket (PATH=/tmp/tmp.8ODsyGsYuv/socket)
May 10 18:24:11 mail slapd[19840]: conn=1001 op=0 BIND dn="" method=163
May 10 18:24:11 mail slapd[19840]: conn=1001 op=0 BIND authcid="gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth" authzid="gidNumber=0+uidNumber=0,cn=d,cn=external,cn=auth"
May 10 18:24:11 mail slapd[19840]: conn=1001 op=0 BIND dn="gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth" mech=EXTERNAL sasl_ssf=0 ssf=71
May 10 18:24:11 mail slapd[19840]: conn=1001 op=0 RESULT tag=97 err=0 text=
May 10 18:24:11 mail slapd[19840]: conn=1001 op=1 SRCH base="cn=schema,cn=config,cn=temporary" scope=2 deref=0 filter="(&(olcObjectClasses=*'pwdpolicy'*)(!(otClasses=*'pwdpolicy'*'pwdmaxrecordedfailure'*))(!(olcAttributeTypes=*'pwdmaxrecordedfailure'*)))"
May 10 18:24:11 mail slapd[19840]: conn=1001 op=1 SRCH attr=dn olcObjectClasses
May 10 18:24:11 mail slapd[19840]: conn=1001 op=1 SEARCH RESULT tag=101 err=0 nentries=0 text=
May 10 18:24:11 mail slapd[19840]: conn=1001 op=2 UNBIND
May 10 18:24:11 mail slapd[19840]: conn=1001 fd=8 closed
May 10 18:24:11 mail slapd[19840]: daemon: shutdown requested and initiated.
May 10 18:24:11 mail slapd[19840]: slapd shutdown: waiting for 0 operations/tasks to finish
May 10 18:24:11 mail slapd[19840]: slapd stopped.
May 10 18:24:11 mail slapd[32729]: daemon: shutdown requested and initiated.
May 10 18:24:11 mail slapd[32729]: slapd shutdown: waiting for 0 operations/tasks to finish
May 10 18:24:11 mail slapd[32729]: slapd stopped.
此為 loglevel 2 ; 改為loglevel 128 log內容相同
後面一直出現:
May 10 18:24:12 mail slapd[19873]: @(#) $OpenLDAP: slapd 2.4.44 (Apr 12 2018 19:17:38) $#012#011mockbuild@x86-01.bsys.centos.org:/builddir/build/BUILD/openld44/openldap-2.4.44/servers/slapd
May 10 18:24:12 mail slapd[19873]: main: TLS init def ctx failed: -1
May 10 18:24:12 mail slapd[19873]: slapd stopped.
May 10 18:24:12 mail slapd[19873]: connections_destroy: nothing to destroy.
maillog
May 10 18:25:01 mail postfix/pickup[17470]: C2FB7C0000120: uid=0 from=<Fail2ban_Mail@mydomain.com>
May 10 18:25:01 mail postfix/proxymap[19761]: warning: dict_ldap_connect: Unable to bind to server ldap://127.0.0.1:389 with dn cn=vmail,dc=mydomain,dc=com: -1 (Can't contact LDAP server)
May 10 18:25:01 mail postfix/cleanup[19758]: warning: proxy:ldap:/etc/postfix/ldap/sender_bcc_maps_user.cf lookup error for "Fail2ban_Mail@mydomain.com"
May 10 18:25:01 mail postfix/cleanup[19758]: warning: C2FB7C0000120: sender_bcc_maps lookup problem
May 10 18:25:01 mail postfix/pickup[17470]: warning: maildrop/B896CD1C4AC34: error writing C2FB7C0000120: queue file write error
#postqueue -p 有500多封信被 queue 住. 已被我刪除
/etc/openldap/slapd.conf 20170703 已被我更改為:
##TLSCACertificateFile /etc/pki/tls/certs/iRedMail.crt
#TLSCACertificateFile /etc/pki/tls/certs/fullchain.pem
#TLSCertificateFile /etc/pki/tls/certs/iRedMail.crt
#TLSCertificateKeyFile /etc/pki/tls/private/iRedMail.key
TLSCACertificateFile /etc/letsencrypt/live/mail.mydomain.com/fullchain.pem
TLSCertificateFile /etc/letsencrypt/live/mail.mydomain.com/cert.pem
TLSCertificateKeyFile /etc/letsencrypt/live/mail.mydomain.com/privkey.pem