[root@hexingxing ~]# chkconfig
// 列出所有运行级别的服务开机运行状态
[root@hexingxing ~]# chkconfig --list nginx
nginx	0: 关闭	1: 关闭	2: 启用	3: 启用	4: 启用	5: 启用	6: 关闭
// 列出 Nginx 服务所有运行级别的开机运行状态
[root@hexingxing ~]# chkconfig --level 245 nginx off
[root@hexingxing ~]# chkconfig --list nginx
nginx	0: 关闭	1: 关闭	2: 关闭	3: 启用	4: 关闭	5: 关闭	6: 关闭
// 设置 Nginx 服务的不同运行级别开机状态,设置级别 2、4、5 不开机运行
[root@hexingxing ~]# chkconfig --level 5 nginx on
[root@hexingxing ~]# chkconfig --list nginx
nginx	0: 关闭	1: 关闭	2: 关闭	3: 启用	4: 关闭	5: 启用	6: 关闭
// 设置 Nginx 服务的不同运行级别开机状态,设置级别 5 开机运行
[root@hexingxing ~]# chkconfig nginx on
[root@hexingxing ~]# chkconfig --list nginx
nginx	0: 关闭	1: 关闭	2: 启用	3: 启用	4: 启用	5: 启用	6: 关闭
// 设置 Nginx 服务开机运行,on 指通用情况下全开模式,指 2、3、4、5 运行级别
[root@hexingxing ~]# chkconfig nginx off
[root@hexingxing ~]# chkconfig --list nginx
nginx	0: 关闭	1: 关闭	2: 关闭	3: 关闭	4: 关闭	5: 关闭	6: 关闭
// 设置 Nginx 服务开机不运行
[root@hexingxing ~]# chkconfig --add httpd
// 添加一个由 chkconfig 管理的 Apache 服务
[root@hexingxing ~]# chkconfig --del httpd
// 删除由 chkconfig 管理的 Apache 服务

查看系统运行级别


何星星原创文章仅用于个人学习,当前页面暂不支持复制操作,了解详情或文章转载请 点此 继续!

0 条评论

发表回复

Avatar placeholder

您的电子邮箱地址不会被公开。 必填项已用*标注