大网数据广告活动
服务器运维问答

openldap: huge logfiles at log level 'stats'

· 52CE 我爱测

I have a linux server running openldap for the user administration. The log level is set to 'stats', which I saw to be the "recommended" log level somewhere. Now the problem is that the log files are growing rapidly, with the vas…

问题原文

原帖链接 · azimut · CC BY-SA 3.0

I have a linux server running openldap for the user administration. The log level is set to 'stats', which I saw to be the "recommended" log level somewhere. Now the problem is that the log files are growing rapidly, with the vast part of entries generated by inquiries from the few KDE 4 clients: Per second, dozends of entries of the following form are created

Apr 19 13:21:50 ###### slapd[1429]: conn=1001 op=26379 SRCH base="dc=###" scope=2 deref=0 filter="(&(objectClass=posixAccount)(uid=####))"
Apr 19 13:21:50 ###### slapd[1429]: conn=1001 op=26379 SRCH attr=uid userPassword uidNumber gidNumber cn homeDirectory loginShell gecos description objectClass
Apr 19 13:21:50 ###### slapd[1429]: conn=1001 op=26379 SEARCH RESULT tag=101 err=0 nentries=1 text=
Apr 19 13:21:50 ###### slapd[1429]: conn=1001 op=26380 SRCH base="dc=###" scope=2 deref=0 filter="(&(objectClass=posixAccount)(uidNumber=####))"
Apr 19 13:21:50 ###### slapd[1429]: conn=1001 op=26380 SRCH attr=uid userPassword uidNumber gidNumber cn homeDirectory loginShell gecos description objectClass
Apr 19 13:21:50 ###### slapd[1429]: conn=1001 op=26380 SEARCH RESULT tag=101 err=0 nentries=1 text=

I don't have a clear idea which exact component of the clients is creating this flood of inquiries. My strong guess is that it is coming from some standard KDE component running in the background when some user is logged in.

  • Is this normal behaviour, or are the clients going wild? Any guess where the inquiries come from?
  • If this is normal, I cannot use the 'stats' level. Is there something more verbose than the log level 'none', which makes sense in my situation?

已采纳解答

原帖链接 · HBruijn · CC BY-SA 3.0

The loglevel=stats is indeed the default log level as described in the manual.

Those seem perfectly valid queries for a Linux system that has a LDAP backend.

The filter: "(&(objectClass=posixAccount)(uid=####))" is lookup for an account with a specific login name. I would expect such queries from your PAM stack when a user tries to log in.

The filter: (&(objectClass=posixAccount)(uidNumber=####)) is lookup for the information associated with the numerical uidNumber. I would expect such queries when your system needs to translate the numerical UID numbers used by your system to the more human friendly loginnames, for instance when a ls -l is performed.

The following account attributes are requested: attr=uid userPassword uidNumber gidNumber cn homeDirectory loginShell gecos description objectClass which are the normal POSIX account attributes for a user account.

That LDAP query is successful and as expected yields exactly 1 result: SEARCH RESULT tag=101 err=0 nentries=1 text. 0 results would also be expected, a username or the numerical uidNumber is unknown, more than 1 result would be interesting, user accounts and numerical uidNumber are supposed to be unique and distinct for each unique user.

You can configure your Linux clients to create and maintain a cache with the results of such queries to a central user directory, which should reduce the load on your LDAP server, result in fewer log entries, and make the clients perform better as well.

Install and enable the nscd (the Name Service Caching Daemon) on the clients. Tuning of the nscd is usually not needed.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2017-04-19)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。