16.04 服务器:启用 LDAP 身份验证导致 systemd-logind 失败

oxt*_*toe 7 server ldap authentication login

我在这里被难住了,对不起,如果我遗漏了一些明显的东西。我有一个针对 LDAP 进行身份验证的 16.04 服务器在我上次运行更新时停止工作,我从头开始构建了一个干净的 16.04 服务器,运行标准更新,并且在我启用 LDAP 身份验证之前它工作正常。我可以禁用 LDAP,然后它又可以工作了。

me@myserver:/etc# systemctl status systemd-logind.service
? systemd-logind.service - Login Service
   Loaded: loaded (/lib/systemd/system/systemd-logind.service; static; vendor preset: enabled)
   Active: activating (start) since Tue 2016-07-12 15:13:07 EDT; 19s ago
     Docs: man:systemd-logind.service(8)
           man:logind.conf(5)
           http://www.freedesktop.org/wiki/Software/systemd/logind
           http://www.freedesktop.org/wiki/Software/systemd/multiseat
 Main PID: 2106 (systemd-logind)
    Tasks: 1
   Memory: 228.0K
      CPU: 2ms
   CGroup: /system.slice/systemd-logind.service
           ??2106 /lib/systemd/systemd-logind

Jul 12 15:13:07 myserver systemd[1]: Starting Login Service...
Run Code Online (Sandbox Code Playgroud)

它会搅动一段时间,失败,然后尝试无限循环重新开始。我可以登录到本地帐户,但需要很长时间。

me@myserver:/etc# systemd-analyze blame
Bootup is not yet finished. Please try again later.
Run Code Online (Sandbox Code Playgroud)

同时 journalctl -xe 返回它自己的更详细的循环:

me@myserver:/etc# journalctl -xe
-- Subject: Unit systemd-logind.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit systemd-logind.service has failed.
-- 
-- The result is failed.
Jul 12 15:16:27 myserver systemd[1]: systemd-logind.service: Unit entered failed state.
Jul 12 15:16:27 myserver systemd[1]: systemd-logind.service: Failed with result 'exit-code'.
Jul 12 15:16:27 myserver systemd[1]: systemd-logind.service: Service has no hold-off time, scheduling restart.
Jul 12 15:16:27 myserver systemd[1]: Stopped Login Service.
-- Subject: Unit systemd-logind.service has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit systemd-logind.service has finished shutting down.
Jul 12 15:16:27 myserver systemd[1]: Starting Login Service...
-- Subject: Unit systemd-logind.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit systemd-logind.service has begun starting up.
Jul 12 15:16:52 myserver systemd-logind[2134]: Failed to enable subscription: Connection timed out
Jul 12 15:16:52 myserver systemd-logind[2134]: Failed to fully start up daemon: Connection timed out
Jul 12 15:16:52 myserver dbus[1012]: [system] Failed to activate service 'org.freedesktop.systemd1': timed out
Jul 12 15:16:52 myserver systemd[1]: systemd-logind.service: Main process exited, code=exited, status=1/FAILURE
Jul 12 15:16:52 myserver systemd[1]: Failed to start Login Service.
Run Code Online (Sandbox Code Playgroud)

我有两打左右的 14.04 服务器使用 LDAP 工作正常,配置相同。

我试过手动重启 systemd-logind 但它失败了。

有任何想法吗?TIA。

(ETA:刚刚在 14.04 上构建了完全相同的系统,LDAP 身份验证工作正常。)

添加 dpkg.log 信息:这个文件中有很多噪音,所以不确定什么是相关和有用的,但这里似乎是相关包的处理终端线:

2016-07-11 13:52:08 status installed libldap-2.4-2:amd64 2.4.42+dfsg-2ubuntu3
2016-07-11 14:11:40 status installed libldap-2.4-2:amd64 2.4.42+dfsg-2ubuntu3.1
2016-07-11 15:02:45 status installed libnss-ldap:amd64 265-3ubuntu2
2016-07-11 15:02:45 status installed ldap-auth-client:all 0.5.3
2016-07-11 15:02:45 status installed ldap-auth-config:all 0.5.3
2016-07-11 15:02:45 status installed libpam-ldap:amd64 184-8.7ubuntu1
2016-07-11 15:04:12 status installed ldap-utils:amd64 2.4.42+dfsg-2ubuntu3.1
Run Code Online (Sandbox Code Playgroud)

我的 LDAP 服务器在别处;该服务器只需要作为客户端对其进行身份验证。/etc/ldap.conf 和 /etc/ldap/ldap.conf 中的配置文件是相同的,并且在 14.04 和 16.04 之间似乎没有变化

值得注意的是,虽然 LDAP 身份验证不起作用,但我可以成功地对 LDAP 服务器执行 ldapsearch 查询。

bar*_*tto 6

我的 16.04 桌面客户端也有同样的问题。

最后解决了用libnss-ldapd替换 libnss-ldap 包。

似乎与此错误报告中的问题相同:https : //bugs.launchpad.net/ubuntu/+source/libnss-ldap/+bug/1024475

编辑:来自Debian wiki 的有关这些软件包的更多信息:

当前有两个包可用于通过 LDAP 配置 NSS 查找:libnss-ldap 包和 libnss-ldapd 包。选择哪一种取决于需求。一般来说,libnss-ldapd 更简单但更新,libnss-ldap 更成熟但更复杂。此外,libnss-ldap 在引导期间提供主机信息和查找方面存在一些已知问题,应在 libnss-ldapd 中解决。此外,libnss-ldap 在使用 LDAP+SSL 时会破坏 setuid 程序(su、sudo)