Systemctl命令的使用及服务状态
Systemctl命令的使用及服务状态
Linux Systemctl是一个系统管理守护进程、工具和库的集合,用于取代System V、Service和chkconfig命令,初始进程主要负责控制systemd系统和服务管理器。通过Systemctl –help可以看到该命令主要分为:查询或发送控制命令给systemd服务,管理单元服务的命令,服务文件的相关命令,任务、环境、快照相关命令,systemd服务的配置重载,系统开机关机相关的命令。
启动服务
旧指令
service nginx start新指令
systemctl start nginx.service
停止服务
旧指令
service nginx stop新指令
systemctl stop nginx.service
重启服务
旧指令
service nginx restart新指令
systemctl restart nginx.service
重新加载服务
- systemctl reload nginx.service
开机启动服务
旧指令
chkconfig –level 3 nginx on新指令
systemctl enable nginx.service
开机禁用服务
旧指令
chkconfig –level 3 nginx off新指令
systemctl disable nginx.service
所有已启动服务
旧指令
chkconfig –list新指令
systemctl list-units –type=service
检查服务状态
旧指令
service nginx status新指令
systemctl status nginx.service
启动失败的服务
- systemctl –failed
全部评论 0
抢沙发