macOS 下的 configd 是什么?

=Start=

缘由:

快速简单记录一下最近看到的一些内容,方便以后参考。

正文:

参考解答:

太长不看的一句话总结:

configd 是 macOS 系统上负责许多本地系统配置的(核心)守护进程。目前,configd 承载的大多数配置代理用于建立和维护网络配置(接口名称、建立和维护IP地址、路由、网络代理等)。

configd is a system configuration daemon that runs behind Mac OS X, most users will never notice or see the core OS X process running in the background of their Macs. With that said, configd can sometimes act up and cause unusual CPU spikes and fan activity making your Mac sound like a wind tunnel. Odd configd behavior is easily diagnosed by launching Activity Monitor, sorting by the “% CPU” option, and seeing the ‘configd’ root user process sitting at the top taking up somewhere between 20-95% CPU. If that behavior lasts for a minute or so it’s usually not a big deal, temporary spikes can be normal so just let it run and ignore it, but there are times where configd can go inexplicably errant and it’ll sit around 50% CPU utilization or more for hours for no obvious reason – that is what we’re looking to resolve here.

$ man configd
...
# DESCRIPTION
The configd daemon is responsible for many configuration aspects of the local system.  configd maintains data reflecting the desired and current state of the system, provides notifications to applications when this data changes, and hosts a number of configuration agents in the form of loadable bundles.

Each configuration agent is responsible for a well-defined aspect of configuration management. The agents look to one or more input sources (preferences, low-level kernel events, configd notifications, etc) and, through a set of policy modules, interacts with the system to establish the desired operational configura-
tion.

Access to the data maintained by configd is via the SystemConfiguration.framework SCDynamicStore APIs.

...
# BUNDLES
At the present time, the majority of the configuration agents (or bundles) hosted by configd are used to establish and maintain the network configuration.  These agents include:

KernelEventMonitor
This bundle is responsible for monitoring kernel events and conveying changes to the network state (e.g. link status) to other configuration agents and interested applications.

InterfaceNamer
This bundle provides a name to each of the system's network interfaces.  The bundle queries the IOKit Registry for a list of network devices attached to the system and gives them BSD style names such as "en0".

IPConfiguration
This agent is responsible for establishing and maintaining IPv4 and IPv6 addresses on the system.  These addresses may be manually specified in the network preferences or acquired using DHCP (or BOOTP), DHCPv6, and RTADV.

IPMonitor
This agent is responsible for establishing and maintaining the primary network service, the default route, the active DNS configuration, and the active network proxies on the system.

LinkConfiguration
This agent is responsible for establishing and maintaining the media type, media options, and MTU for ethernet interfaces.

PreferencesMonitor
This agent is responsible for conveying the network configuration preferences specified by the administrator to the various configuration agents (IPv4, IPv6, ...).

PPPController
This agent is responsible for establishing and maintaining PPP connections on the system.

macOS上一个和configd进程和log命令有关的小技巧:

log show --predicate '(processImagePath contains "configd") && (eventMessage contains "en0: SSID ")' --style syslog --last 1d

根据我本机的实际测试,macOS 下的 log 命令记录了大概1个月以内的数据(这个应该和个人的实际使用产生的日志量大小有关,日志越多,记录的时间相应越短),一般排查还是够用了的。

参考链接:

configd: Fixing High CPU Usage Problems with the configd Process in Mac OS X
https://osxdaily.com/2013/09/30/configd-mac-os-x-fix/

What Is configd, and Why Is It Running On My Mac?
https://www.howtogeek.com/338196/what-is-configd-and-why-is-it-running-on-my-mac/

什么已配置?为什么在Mac上运行?
https://blog.csdn.net/culinqian4296/article/details/108781314

What Is This Process and Why Is It Running on My Mac?
https://www.howtogeek.com/312671/what-is-this-process-and-why-is-it-running-on-my-mac/

=END=

声明: 除非注明,ixyzero.com文章均为原创,转载请以链接形式标明本文地址,谢谢!
https://ixyzero.com/blog/archives/5023.html

发表评论

电子邮件地址不会被公开。 必填项已用*标注