Skip to main content

4.2. systemd

David LiuLess than 1 minute

4.2. systemd

目的

增加并发性、减少 shell 开发

争议

红帽的,来顶替 init 进程,

违反 unix 哲学,因为过于复杂,不单一职责

systemctl

可以控制 systemd 系统和服务管理

systemctl disable/enable xxx 关闭/打开开机自启动

systemctl start [name.service]
systemctl stop [name.service]
systemctl restart [name.service]
systemctl reload [name.service]
systemctl status [name.service]
systemctl is-active [name.service] # 检查是否在运行
systemctl list-units --type [name.service]
# equals to: chkconfig --list
systemctl enable [name.service] # 打开开机自启动
systemctl disable [name.service] # 关闭开机自启动