又双叒叕想盘一下systemd
直接开唠,百度一下systemd,找到这个了:
链接:https://github.com/systemd/systemd/,点进去,翻一翻,就看到这个了:
链接是这个:https://systemd.io/,网页的开头有个介绍:
就这一小段,对不了解这个的我,信息量也很大啊,幸好有AI帮着看
systemd is a suite of basic building blocks for a Linux system. It provides a system and service manager that runs as PID 1 and starts the rest of the system.
suite,套装;basic building blocks,基础构建模块,查了下block确有这样的意思:
就是说systemd 是Linux 系统里重要的、基础设施级别的一个套装;
系统启动时它作为pid为1的进程启动,并且负责启动系统的其余部分。好理解,继续看。
systemd provides aggressive parallelization capabilities,
aggressive,激进的。就是说,systemd启动和管理系统服务时,会最大限度得利用并行处理能力,而不是像传统系统五(System V)那样按顺序逐个启动。
uses socket and D-Bus activation for starting services,
旧式的系统启动时,如果选择了开机直接启动,即无论服务是否立即需要,都会占用内存和 CPU;否则,就要手动或脚本调用/etc/init.d/service start来启动;
systemd引入2种解决方案,Socket Activation,即服务不立即启动,先由systemd监听端口,当第一个连接请求到达时,systemd才启动服务、移交套接字;
另一种方案是D-Bus Activation。D-Bus 是 Linux 上进程间通信(IPC)的总线系统。 服务可以注册到 D-Bus 总线,声明自己能处理的接口,当其他进程首次调用该接口时,systemd 自动启动对应服务。
offers on-demand starting of daemons, 这一个短句表达的内容和前一短句似乎一样
keeps track of processes using Linux control groups, 利用cgroups来跟踪进程。
control groups即cgroups,是linux内核提供的一种机制,算了,直接上图:
maintains mount and automount points, 就是系统挂载点也是systemd来处理的,貌似除了字面意思没啥别的,继续
and implements an elaborate transactional dependency-based service control logic.
字面意思是:实现了精密的、基于事务和依赖关系的服务控制逻辑,。。。
systemd supports SysV and LSB init scripts and works as a replacement for sysvinit.
LSB是Linux Standard Base(Linux 标准基础),这句就是字面意思了,一时没必要细看。
继续看,好吧,这一段就是一句话啊:
就是说修改这些系统配置的工具都是systemd套装的一部分呗。
除了开头拿一部分,至刚才的内容都是参考AI的回复,我这里只图个大致的认识,眼下就不逐条考证真实性了。继续看网页,貌似这才是我想要看的:
上边的图上,每个链接我都点进去了看了,没有很直接有效的示例,那换个思路,找个空系统,安装个redis,再去看看/usr/lib/systemd/system/redis.service里都是啥,以及都是什么意思
Fxxx,来活了,改天再说吧