Systemd是一个系统管理守护进程、工具和库的集合,用于取代System V初始进程。Systemd的功能是用于集中管理和配置类UNIX系统。
在Linux生态系统中,Systemd被部署到了大多数的标准Linux发行版中,只有为数不多的几个发行版尚未部署。Systemd通常是所有其它守护进程的父进程,但并非全是如此。
1、原来的 service 命令与 systemctl 命令对比
daemon命令 | systemctl命令 | 说明 |
---|---|---|
service [服务] start | systemctl start [unit type] | 启动服务 |
service [服务] stop | systemctl stop [unit type] | 停止服务 |
service [服务] restart | systemctl restart [unit type] | 重启服务 |
此外还是二个systemctl参数没有与service命令参数对应
示例:
#启动网络服务
systemctl start network.service
#停止网络服务
systemctl stop network.service
#重启网络服务
systemctl restart network.service
#查看网络服务状态
systemctl status network.serivce
2、原来的chkconfig 命令与 systemctl 命令对比
daemon命令 | systemctl命令 | 说明 |
---|---|---|
chkconfig [服务] on | systemctl enable [unit type] | 设置服务开机启动 |
chkconfig [服务] off | systemctl disable [unit type] | 设备服务禁止开机启动 |
示例:
#停止cup电源管理服务
systemctl stop cups.service
#禁止cups服务开机启动
systemctl disable cups.service
#查看cups服务状态
systemctl status cups.service
#重新设置cups服务开机启动
systemctl enable cups.service
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。