刚刚使用centos 7的时候,多数朋友会用的不是很顺手,尽管多了许多神乎其神的功能,但是对于基础的服务管理与网络管理方面的变化,还是让人褒贬不一。在centos7中,chkconfig与service命令没有之前那么好用,取而代之的是systemctl命令,这个强大的命令是一个系统管理守护进程、工具和库的集合。
任务 | 旧命令 | 新命令 |
使某服务自动启动 | chkconfig httpd on | systemctl enable httpd.service |
使某服务不自动启动 | chkconfig httpd off | systemctl disable httpd.service |
检查服务状态 | service httpd status | systemctl status httpd.service |
启动某服务 | service httpd start | systemctl start httpd.service |
停止某服务 | service httpd stop | systemctl stop httpd.service |
重启某服务 | service httpd restart | systemctl restart httpd.service |
显示所有已启动的服务 | chkconfig –list | systemctl list-unit-files|grep enabled |