AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 1042741
Accepted
CertifcateJunky
CertifcateJunky
Asked: 2018-06-02 12:07:46 +0800 CST2018-06-02 12:07:46 +0800 CST 2018-06-02 12:07:46 +0800 CST

处理 slapd 时遇到的错误

  • 772

我正在尝试在 ubuntu 16.04 上设置 ldap 服务器。在安装 ldap-utils 和 slapd 期间,我得到以下信息:

Setting up slapd (2.4.42+dfsg-2ubuntu3.2) ...
  Moving old database directory to /var/backups:
  - directory unknown... done.
  Creating initial configuration... done.
  Creating LDAP directory... done.
Job for slapd.service failed because the control process exited with error code. See "systemctl status slapd.service" and "journalctl -xe" for details.
invoke-rc.d: initscript slapd, action "start" failed.
● slapd.service - LSB: OpenLDAP standalone server (Lightweight Directory Access Protocol)
   Loaded: loaded (/etc/init.d/slapd; bad; vendor preset: enabled)
   Active: failed (Result: exit-code) since Fri 2018-06-01 15:04:58 CDT; 4ms ago
     Docs: man:systemd-sysv-generator(8)
  Process: 3107 ExecStart=/etc/init.d/slapd start (code=exited, status=1/FAILURE)

Jun 01 15:04:58 TBG-Magic systemd[1]: Starting LSB: OpenLDAP standalone server (Lightweight Directory Access Protocol)...
Jun 01 15:04:58 TBG-Magic slapd[3107]:  * Starting OpenLDAP slapd
Jun 01 15:04:58 TBG-Magic slapd[3115]: @(#) $OpenLDAP: slapd  (Ubuntu) (May 30 2017 19:20:53) $
                                               buildd@lgw01-18:/build/openldap-JXEADB/openldap-2.4.42+dfsg/debian/build/servers/slapd
Jun 01 15:04:58 TBG-Magic slapd[3115]: daemon: bind(9) failed errno=98 (Address already in use)
Jun 01 15:04:58 TBG-Magic slapd[3107]:    ...fail!
Jun 01 15:04:58 TBG-Magic systemd[1]: slapd.service: Control process exited, code=exited status=1
Jun 01 15:04:58 TBG-Magic systemd[1]: Failed to start LSB: OpenLDAP standalone server (Lightweight Directory Access Protocol).
Jun 01 15:04:58 TBG-Magic systemd[1]: slapd.service: Unit entered failed state.
Jun 01 15:04:58 TBG-Magic systemd[1]: slapd.service: Failed with result 'exit-code'.
dpkg: error processing package slapd (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up ldap-utils (2.4.42+dfsg-2ubuntu3.2) ...
Processing triggers for libc-bin (2.23-0ubuntu10) ...
Processing triggers for systemd (229-4ubuntu21.2) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for ufw (0.35-0ubuntu2) ...
Rules updated for profile 'OpenSSH'
Skipped reloading firewall
Errors were encountered while processing:
 slapd
E: Sub-process /usr/bin/dpkg returned an error code (1)

运行的日志journalctl -xe如下所示:

-- Subject: Unit slapd.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit slapd.service has begun starting up.
Jun 01 15:16:33 TBG-Magic slapd[7009]:  * Starting OpenLDAP slapd
Jun 01 15:16:33 TBG-Magic slapd[7018]: @(#) $OpenLDAP: slapd  (Ubuntu) (May 30 2017 19:20:53) $
                                               buildd@lgw01-18:/build/openldap-JXEADB/openldap-2.4.42+dfsg/debian/build/servers/slapd
Jun 01 15:16:33 TBG-Magic slapd[7018]: daemon: bind(9) failed errno=98 (Address already in use)
Jun 01 15:16:33 TBG-Magic slapd[7018]: daemon: bind(9) failed errno=98 (Address already in use)
Jun 01 15:16:33 TBG-Magic slapd[7018]: slapd stopped.
Jun 01 15:16:33 TBG-Magic slapd[7018]: connections_destroy: nothing to destroy.
Jun 01 15:16:33 TBG-Magic slapd[7009]:    ...fail!
Jun 01 15:16:33 TBG-Magic systemd[1]: slapd.service: Control process exited, code=exited status=1
Jun 01 15:16:33 TBG-Magic systemd[1]: Failed to start LSB: OpenLDAP standalone server (Lightweight Directory Access Protocol).
-- Subject: Unit slapd.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit slapd.service has failed.
-- 
-- The result is failed.
Jun 01 15:16:33 TBG-Magic systemd[1]: slapd.service: Unit entered failed state.
Jun 01 15:16:33 TBG-Magic systemd[1]: slapd.service: Failed with result 'exit-code'.

运行sudo apt-get remove --purge slapd并重新安装后。安装时我仍然遇到同样的错误。我该如何解决这个问题?

apt ldap
  • 1 1 个回答
  • 2134 Views

1 个回答

  • Voted
  1. Best Answer
    CertifcateJunky
    2018-06-02T12:24:27+08:002018-06-02T12:24:27+08:00

    问题是某些东西已经在使用该地址,您可以从此处的日志文件中看到:

    Jun 01 15:16:33 TBG-Magic slapd[7018]: daemon: bind(9) failed errno=98 (Address already in use)
    

    我意识到之前我已经安装了samba和smbldap-tools. 删除这两个sudo apt-get remove --purge samba smbldap-tools结果如下:

    serveradmin@TBG-Magic:~$ sudo service slapd status
    ● slapd.service - LSB: OpenLDAP standalone server (Lightweight Directory Access Protocol)
       Loaded: loaded (/etc/init.d/slapd; bad; vendor preset: enabled)
       Active: active (running) since Fri 2018-06-01 15:21:19 CDT; 23s ago
         Docs: man:systemd-sysv-generator(8)
      Process: 8708 ExecStart=/etc/init.d/slapd start (code=exited, status=0/SUCCESS)
        Tasks: 3
       Memory: 2.5M
          CPU: 18ms
       CGroup: /system.slice/slapd.service
               └─8717 /usr/sbin/slapd -h ldap:/// ldapi:/// -g openldap -u openldap -F /etc/ldap/slapd.d
    
    Jun 01 15:21:17 TBG-Magic systemd[1]: Starting LSB: OpenLDAP standalone server (Lightweight Directory Access Protocol)...
    Jun 01 15:21:17 TBG-Magic slapd[8708]:  * Starting OpenLDAP slapd
    Jun 01 15:21:17 TBG-Magic slapd[8716]: @(#) $OpenLDAP: slapd  (Ubuntu) (May 30 2017 19:20:53) $
                                                   buildd@lgw01-18:/build/openldap-JXEADB/openldap-2.4.42+dfsg/debian/build/servers/slapd
    Jun 01 15:21:19 TBG-Magic slapd[8717]: slapd starting
    Jun 01 15:21:19 TBG-Magic slapd[8708]:    ...done.
    Jun 01 15:21:19 TBG-Magic systemd[1]: Started LSB: OpenLDAP standalone server (Lightweight Directory Access Protocol).
    
    • 1

相关问题

  • 如何查看存档中可用的软件包的所有版本?

  • 是否可以说出我安装的哪些软件包不在原版安装中?

  • 如何删除 PPA?

  • 使用 apt-get upgrade 时如何强制安装内核更新?

  • 从共享 NFS /home 到完整的 LDAP 解决方案

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve