linux chkconfig 和 systemctl 区别 对比
生活随笔
收集整理的这篇文章主要介绍了
linux chkconfig 和 systemctl 区别 对比
小编觉得挺不错的,现在分享给大家,帮大家做个参考.
chkconfig命令
Copy主要用来更新(启动或停止)和查询系统服务(service)的运行级信息,用于维护/etc/rc[0-6].d目录的命令行工具。chkconfig -–add httpd增加httpd服务chkconfig –-del httpd删除httpd服务chkconfig –-list列出系统所有的服务启动情况chkconfig –-list mysqld列出mysqld服务设置情况chkconfig –-level 35 mysqld on设定mysqld在等级3和5为开机运行服务(on表示开机启动,off表示开机不启动,reset指重置服务的启动信息)chkconfig mysqld on设定mysqld在各等级为on,“各等级”包括2、3、4、5等级等级0表示:表示关机 等级1表示:单用户模式 等级2表示:无网络连接的多用户命令行模式 等级3表示:有网络连接的多用户命令行模式 等级4表示:不可用 等级5表示:带图形界面的多用户模式 等级6表示:重新启动systemctl(代替chkconfig和service)
Copy在 Centos 中 systemctl 是设置系统服务(service)的命令,它融合之前service和chkconfig的功能于一体。 可以使用它永久性或只在当前会话中启用/禁用服务。启动、停止、重启、重载服务systemctl start name.servicesystemctl stop name.servicesystemctl restart name.servicesystemctl reload name.service查看某个服务(单元)的状态systemctl status name.service激活/禁止自动启动systemctl enable httpd.servicesystemctl disable httpd.service杀死服务systemctl kill httpdchkconfig 和 systemctl 区别对比
| 使某服务自动启动 | chkconfig --level 3 httpd on | systemctl enable httpd.service |
| 使某服务不自动启动 | chkconfig --level 3 httpd off | systemctl disable httpd.service |
| 检查服务状态 | service httpd status | systemctl status httpd.service(服务详细信息) / systemctl is-active httpd.service (仅显示是否 Active) |
| 加入自定义服务 | chkconfig --add test | systemctl load test.service |
| 删除服务 | chkconfig --del xxx | 停掉应用,删除相应的配置文件 |
| 显示所有已启动的服务 | chkconfig --list | systemctl list-units --type=service |
| 启动某服务 | service httpd start | systemctl start httpd.service |
| 停止某服务 | service httpd stop | systemctl stop httpd.service |
| 重启某服务 | service httpd restart | systemctl restart httpd.service |
总结
以上是生活随笔为你收集整理的linux chkconfig 和 systemctl 区别 对比的全部内容,希望文章能够帮你解决所遇到的问题。
- 上一篇: linux安装minikube(Ubun
- 下一篇: linux rename命令使用示例