SSSD 进程不会死

omn*_*vir 6 linux ldap kill process sssd

感谢您花时间检查我的问题。

我目前正在处理一个以前只出现过一次的问题。回到 1 月 3 日,当它第一次出现时,我们能够重新启动服务器,一切似乎都很好,但现在又回来了。这是一个生产数据库系统,因此有时很难找到重新启动的窗口。我希望在我们几天后再次重新启动以提供另一个临时解决方案之前,能够牢牢掌握这次可能发生的实际情况。开始了...

相关系统的用户身份验证通过 Red Hat Directory Server 9 使用 LDAP 处理。下面描述的问题仅在这台服务器上出现,即使是共享数据库的对应服务器也不会显示相同的症状。截至目前,没有任何 LDAP 帐户能够进行身份验证并登录到服务器。LDAP 身份验证正在由 SSSD 处理,目前无法停止或重新启动。尝试执行任一操作时,SSH 控制台都没有响应。(ctrl-c 无法退出发出的命令)

PS 显示通常的 sssd 相关进程正在运行,但kill -9对它们的尝试似乎并没有成功阻止它们中的任何一个。

ps aux | grep sss | grep -v grep
root      1150  0.0  0.0 150828  2908 ?        D    09:05   0:00 /usr/libexec/sssd/sssd_nss -d 0 --debug-to-files
root      7025  0.0  0.0  93616  2504 pts/2    D    16:18   0:00 /usr/sbin/sssd -f -D
root     11148  0.0  0.0 179436  5672 ?        D    Jan08  16:22 /usr/libexec/sssd/sssd_be -d 0 --debug-to-files --domain default
root     32700  0.0  0.0 150784  2908 ?        D    10:10   0:00 /usr/libexec/sssd/sssd_pam -d 0 --debug-to-files
Run Code Online (Sandbox Code Playgroud)

使用strace getent -s sss passwd我可以看到一些连接尝试被拒绝,但我不确定如何处理它们。

connect(3, {sa_family=AF_FILE, path="/var/lib/sss/pipes/nss"...}, 110) = -1 ECONNREFUSED (Connection refused)
close(3)                                = 0
socket(PF_FILE, SOCK_STREAM, 0)         = 3
fcntl(3, F_GETFL)                       = 0x2 (flags O_RDWR)
fcntl(3, F_SETFL, O_RDWR|O_NONBLOCK)    = 0
fcntl(3, F_GETFD)                       = 0
fcntl(3, F_SETFD, FD_CLOEXEC)           = 0
connect(3, {sa_family=AF_FILE, path="/var/lib/sss/pipes/nss"...}, 110) = -1 ECONNREFUSED     (Connection refused)
close(3)                                = 0
socket(PF_FILE, SOCK_STREAM, 0)         = 3
fcntl(3, F_GETFL)                       = 0x2 (flags O_RDWR)
fcntl(3, F_SETFL, O_RDWR|O_NONBLOCK)    = 0
fcntl(3, F_GETFD)                       = 0
fcntl(3, F_SETFD, FD_CLOEXEC)           = 0
connect(3, {sa_family=AF_FILE, path="/var/lib/sss/pipes/nss"...}, 110) = -1 ECONNREFUSED (Connection refused)
Run Code Online (Sandbox Code Playgroud)

检查lsof | head -n1; lsof | grep /var/lib/sss/pipes/显示好系统和坏系统之间的开放管道要少得多。这些管道的 PID 与 报告的相同ps aux,因此kill -9对它们的尝试也没有结果。

坏固态硬盘

lsof | head -n1; lsof | grep /var/lib/sss/pipes/
COMMAND     PID         USER   FD      TYPE             DEVICE    SIZE/OFF       NODE NAME
sssd_be   11148         root   15u     unix 0xffff8806635911c0         0t0   31817638 /var/lib/sss/pipes/private/sbus-dp_default.11148
sssd_be   11148         root   16u     unix 0xffff880d443d6180         0t0   31783555 /var/lib/sss/pipes/private/sbus-dp_default.11148
sssd_be   11148         root   17u     unix 0xffff880c536d94c0         0t0   31783560 /var/lib/sss/pipes/private/sbus-dp_default.11148
Run Code Online (Sandbox Code Playgroud)

好固态硬盘

lsof | head -n1; lsof | grep /var/lib/sss/pipes/
COMMAND     PID         USER   FD      TYPE             DEVICE    SIZE/OFF       NODE NAME
sssd      26793         root   13u     unix 0xffff88030b5d8c40         0t0 3248762734 /var/lib/sss/pipes/private/sbus-monitor
sssd      26793         root   14u     unix 0xffff8808cc064bc0         0t0 3248762735 /var/lib/sss/pipes/private/sbus-monitor
sssd      26793         root   15u     unix 0xffff880a9d9bc840         0t0 3248768164 /var/lib/sss/pipes/private/sbus-monitor
sssd      26793         root   16u     unix 0xffff880040a32f00         0t0 3248768165 /var/lib/sss/pipes/private/sbus-monitor
sssd_be   26794         root   15u     unix 0xffff8808cc064200         0t0 3248767368 /var/lib/sss/pipes/private/sbus-dp_default.26794
sssd_be   26794         root   16u     unix 0xffff880a9d9bd880         0t0 3248763661 /var/lib/sss/pipes/private/sbus-dp_default.26794
sssd_be   26794         root   17u     unix 0xffff8809841b4480         0t0 3248763662 /var/lib/sss/pipes/private/sbus-dp_default.26794
sssd_nss  26795         root   16u     unix 0xffff880a9d9bd200         0t0 3248751954 /var/lib/sss/pipes/nss
sssd_pam  26796         root   16u     unix 0xffff880859e26180         0t0 3248774325 /var/lib/sss/pipes/pam
sssd_pam  26796         root   17u     unix 0xffff880859e27b80         0t0 3248774326 /var/lib/sss/pipes/private/pam
Run Code Online (Sandbox Code Playgroud)

此外,/var/log/secure 包含多个条目

sshd[9177]: pam_succeed_if(sshd:auth): error retrieving information about user
su: pam_sss(su-l:session): Request to sssd failed. Connection refuse
crond[29568]: pam_sss(crond:session): Request to sssd failed. Connection refused
Run Code Online (Sandbox Code Playgroud)

此外,我注意到的第一件事是 /var/log/messages 文件不包含任何数据。它和 /var/log/sssd/ 日志似乎在今天早上 9 点 03 分左右停止收集,/var/log/secure 继续积累数据,没有问题。重新启动 syslog 修复了消息的问题,但 sssd 日志仍然无法运行。

我最后注意到 dmesg 充满了像audit: backlog limit exceeded audit: audit_backlog=322 > audit_backlog_limit=320和这样的消息audit_log_start: 122 callbacks suppressed。我认为这些是在 syslog 无法正常工作时产生的,但尚未验证。

我仍在研究这个并希望我能找到一些东西,但非常欢迎人们愿意提供任何建议和反馈。

非常感谢!

-Omni

Mat*_*att 0

我遇到了在同一系统上运行 pam_ldap 和 sssd 的问题。如果您想停止将 sssd 与 pam 一起使用,您应该确保运行:

pam-config -a --ldap
Run Code Online (Sandbox Code Playgroud)

这会将 LDAP 添加到 pam,然后运行:

pam-config -d --sss
Run Code Online (Sandbox Code Playgroud)

这将删除 /etc/pam.d/ 中 pam 相关配置文件中的 sssd 设置

为了确保不使用 sss,您可能还需要检查 nsswitch.conf 是否在正确的位置有 ldap(或者至少没有 sss)。这是启用了 sss 的 /etc/nsswitch.conf:

#
# /etc/nsswitch.conf
#
# An example Name Service Switch config file. This file should be
# sorted with the most-used services at the beginning.
#
# The entry '[NOTFOUND=return]' means that the search for an
# entry should stop if the search in the previous entry turned
# up nothing. Note that if the search failed due to some other reason
# (like no NIS server responding) then the search continues with the
# next entry. 
#  
# Legal entries are:
#
#       compat                  Use compatibility setup
#       nisplus                 Use NIS+ (NIS version 3)
#       nis                     Use NIS (NIS version 2), also called YP
#       dns                     Use DNS (Domain Name Service)
#       files                   Use the local files
#       [NOTFOUND=return]       Stop searching if not found so far  
#
# For more information, please read the nsswitch.conf.5 manual page.
#

passwd: compat sss
group:  compat sss

hosts:  files mdns_minimal [NOTFOUND=return] dns
networks:   files dns

services:   files
protocols:  files
rpc:    files
ethers: files
netmasks:   files
netgroup:   files
publickey:  files

bootparams: files
automount:  files
aliases:    files
passwd_compat:  files
group_compat:   files
Run Code Online (Sandbox Code Playgroud)

该文件禁用了 sss 并启用了 ldap:

passwd: compat ldap
group:  compat ldap

hosts:  files mdns_minimal [NOTFOUND=return] dns
networks:   files dns

services:   files
protocols:  files
rpc:    files
ethers: files
netmasks:   files
netgroup:   files
publickey:  files

bootparams: files
automount:  files
aliases:    files
passwd_compat:  files
group_compat:   files
Run Code Online (Sandbox Code Playgroud)