Linux的启动级别
cat /etc/inittab
id:3:initdefault: ##可以看出默认为三
[root@localhost ~]# chkconfig --list nfs
nfs 0:off 1:off 2:off 3:off 4:off 5:off 6:off
分别为:
# 0 - halt (Do NOT set initdefault to this)
# 1 - Single user mode
# 2 - Multiuser, without NFS (The same as 3, if you do not have networking)
# 3 - Full multiuser mode
# 4 - unused
# 5 - X11
# 6 - reboot (Do NOT set initdefault to this)
各个运行级的详细解释:
0 为停机,机器关闭。
1 为单用户模式,就像Win9x下的安全模式类似。
2 为多用户模式,但是没有NFS支持。
3 为完整的多用户模式,是标准的运行级。
4 一般不用,在一些特殊情况下可以用它来做一些事情。例如在笔记本电脑的电池用尽时,可以切换到这个模式来做一些设置。
5 就是X11,进到X Window系统了。
6 为重启,运行init 6机器就会重启。
同样 /etc/rc[0-6].d 都是连接的相应的 /etc/rc.d/rc[0-6].d ,不同启动级别的 rc[0-6].d 中的服务都是 链接的 /etc/init.d 下的相应服务
语法:
chkconfig --list [name]
chkconfig --add name
chkconfig --del name
chkconfig [--level levels] name <on|off|reset>
chkconfig [--level levels] name
--level选项可以指定要查看的运行级而不一定是当前运行级。
需要说明的是,对于每个运行级,只能有一个启动脚本或者停止脚本。当切换运行级时,init不会重新启动已经启动的服务,也不会再次去停止已经停止的服务。
chkconfig --level 345 nfs off
id:3:initdefault:
sendmail 0:off 1:off 2:on 3:on 4:on 5:on 6:off
查看连接 :
ll /etc/rc0.d/ |grep sendmail
lrwxrwxrwx 1 root root 18 Nov 5 23:43 K30sendmail -> ../init.d/sendmail
ll /etc/rc1.d/ |grep sendmail
lrwxrwxrwx 1 root root 18 Nov 5 23:43 K30sendmail -> ../init.d/sendmail
ll /etc/rc2.d/ |grep sendmail
lrwxrwxrwx 1 root root 18 Nov 5 23:43 S80sendmail -> ../init.d/sendmail
ll /etc/rc3.d/ |grep sendmail
lrwxrwxrwx 1 root root 18 Nov 5 23:43 S80sendmail -> ../init.d/sendmail
ll /etc/rc4.d/ |grep sendmail
lrwxrwxrwx 1 root root 18 Nov 5 23:43 S80sendmail -> ../init.d/sendmail
ll /etc/rc5.d/ |grep sendmail
lrwxrwxrwx 1 root root 18 Nov 5 23:43 S80sendmail -> ../init.d/sendmail
ll /etc/rc6.d/ |grep sendmail
lrwxrwxrwx 1 root root 18 Nov 5 23:43 K30sendmail -> ../init.d/sendmail
[root@localhost init.d]# chkconfig --list sendmail
service sendmail supports chkconfig, but is not referenced in any runlevel (run 'chkconfig --add sendmail')
查看连接
[root@localhost init.d]# ll /etc/rc0.d/ |grep sendmail
[root@localhost init.d]# ll /etc/rc0.d/ |grep sendmail
[root@localhost init.d]# ll /etc/rc1.d/ |grep sendmail
[root@localhost init.d]# ll /etc/rc2.d/ |grep sendmail
[root@localhost init.d]# ll /etc/rc3.d/ |grep sendmail
[root@localhost init.d]# ll /etc/rc4.d/ |grep sendmail
[root@localhost init.d]# ll /etc/rc5.d/ |grep sendmail
[root@localhost init.d]# ll /etc/rc6.d/ |grep sendmail
[root@localhost init.d]# ---》 全为空
[root@localhost init.d]# chkconfig --add sendmail
[root@localhost init.d]# chkconfig --list sendmail
sendmail 0:off 1:off 2:on 3:on 4:on 5:on 6:off
[root@localhost init.d]# ll /etc/rc0.d/ |grep sendmail
lrwxrwxrwx 1 root root 18 Nov 10 23:33 K30sendmail -> ../init.d/sendmail
[root@localhost init.d]# ll /etc/rc1.d/ |grep sendmail
lrwxrwxrwx 1 root root 18 Nov 10 23:33 K30sendmail -> ../init.d/sendmail
[root@localhost init.d]# ll /etc/rc2.d/ |grep sendmail
lrwxrwxrwx 1 root root 18 Nov 10 23:33 S80sendmail -> ../init.d/sendmail
[root@localhost init.d]# ll /etc/rc3.d/ |grep sendmail
lrwxrwxrwx 1 root root 18 Nov 10 23:33 S80sendmail -> ../init.d/sendmail
[root@localhost init.d]# ll /etc/rc4.d/ |grep sendmail
lrwxrwxrwx 1 root root 18 Nov 10 23:33 S80sendmail -> ../init.d/sendmail
[root@localhost init.d]# ll /etc/rc5.d/ |grep sendmail
lrwxrwxrwx 1 root root 18 Nov 10 23:33 S80sendmail -> ../init.d/sendmail
[root@localhost init.d]# ll /etc/rc6.d/ |grep sendmail
lrwxrwxrwx 1 root root 18 Nov 10 23:33 K30sendmail -> ../init.d/sendmail ----》 相应的服务连接又回来了
[root@localhost init.d]# chkconfig --list sendmail
sendmail 0:off 1:off 2:off 3:off 4:off 5:off 6:off
[root@localhost init.d]# ll /etc/rc0.d/ |grep sendmail
lrwxrwxrwx 1 root root 18 Nov 10 23:33 K30sendmail -> ../init.d/sendmail
[root@localhost init.d]# ll /etc/rc1.d/ |grep sendmail
lrwxrwxrwx 1 root root 18 Nov 10 23:33 K30sendmail -> ../init.d/sendmail
[root@localhost init.d]# ll /etc/rc2.d/ |grep sendmail
lrwxrwxrwx 1 root root 18 Nov 10 23:36 K30sendmail -> ../init.d/sendmail
[root@localhost init.d]# ll /etc/rc3.d/ |grep sendmail
lrwxrwxrwx 1 root root 18 Nov 10 23:36 K30sendmail -> ../init.d/sendmail
[root@localhost init.d]# ll /etc/rc4.d/ |grep sendmail
lrwxrwxrwx 1 root root 18 Nov 10 23:36 K30sendmail -> ../init.d/sendmail
[root@localhost init.d]# ll /etc/rc5.d/ |grep sendmail
lrwxrwxrwx 1 root root 18 Nov 10 23:36 K30sendmail -> ../init.d/sendmail
[root@localhost init.d]# ll /etc/rc6.d/ |grep sendmail
lrwxrwxrwx 1 root root 18 Nov 10 23:33 K30sendmail -> ../init.d/sendmail ---》全是 "K"
[root@localhost init.d]# chkconfig --list sendmail
sendmail 0:off 1:off 2:on 3:on 4:on 5:on 6:off
[root@localhost init.d]# ll /etc/rc0.d/ |grep sendmail
lrwxrwxrwx 1 root root 18 Nov 10 23:33 K30sendmail -> ../init.d/sendmail
[root@localhost init.d]# ll /etc/rc1.d/ |grep sendmail
lrwxrwxrwx 1 root root 18 Nov 10 23:33 K30sendmail -> ../init.d/sendmail
[root@localhost init.d]# ll /etc/rc2.d/ |grep sendmail
lrwxrwxrwx 1 root root 18 Nov 10 23:40 S80sendmail -> ../init.d/sendmail
[root@localhost init.d]# ll /etc/rc3.d/ |grep sendmail
lrwxrwxrwx 1 root root 18 Nov 10 23:40 S80sendmail -> ../init.d/sendmail
[root@localhost init.d]# ll /etc/rc4.d/ |grep sendmail
lrwxrwxrwx 1 root root 18 Nov 10 23:40 S80sendmail -> ../init.d/sendmail
[root@localhost init.d]# ll /etc/rc5.d/ |grep sendmail
lrwxrwxrwx 1 root root 18 Nov 10 23:40 S80sendmail -> ../init.d/sendmail
[root@localhost init.d]# ll /etc/rc6.d/ |grep sendmail
lrwxrwxrwx 1 root root 18 Nov 10 23:33 K30sendmail -> ../init.d/sendmail --》2,3,4,5 为“S” 其他为 K
chkconfig sendmail off
[root@localhost init.d]# chkconfig --list sendmail
sendmail 0:off 1:off 2:off 3:off 4:off 5:off 6:off
[root@localhost init.d]# chkconfig --level 3 sendmail on
[root@localhost init.d]# chkconfig --list sendmail
sendmail 0:off 1:off 2:off 3:on 4:off 5:off 6:off
[root@localhost init.d]# chkconfig --level 0 sendmail on
[root@localhost init.d]# chkconfig --list sendmail
sendmail 0:on 1:off 2:off 3:on 4:off 5:off 6:off --》 看来 得用level on 参数控制 0级别
[root@localhost init.d]# chkconfig --list sendmail
sendmail 0:on 1:off 2:off 3:off 4:off 5:off 6:off --》 但是这样3 级别关了 0 级别没关掉
[root@localhost init.d]# chkconfig --list sendmail
sendmail 0:off 1:off 2:off 3:off 4:off 5:off 6:off --》 0 级别关掉了 (经验证1,6级别 也是这样的和0级别一样 得用level控制)
[root@localhost init.d]# chkconfig sendmail off
[root@localhost init.d]# chkconfig --list sendmail
sendmail 0:off 1:off 2:off 3:off 4:off 5:off 6:off
[root@localhost init.d]# chkconfig sendmail reset
[root@localhost init.d]# chkconfig --list sendmail
sendmail 0:off 1:off 2:on 3:on 4:on 5:on 6:off --》 reset指重置服务的启动信息 可以对所有运行级有效 (没太懂这个东西reset)
Linux的启动级别的更多相关文章
- 修改Linux默认启动级别或模式的方法
冲动的惩罚: 海阔天空: 在linux系统的7种启动级别,默认为X-Window,类似于Windows的窗口模式. 如何修改或变更linux的默认启动级别或模式呢? 以root身份进入Linux,修改 ...
- 修改Linux默认启动级别或模式
在Linux中有7种启动级别,默认是X-Window,像是Windows的窗口模式,而Linux的操作和配置一般我们都采用输入命令的方式来完成,像DOS操作系统一样,如何让Linux一启动就进入这种模 ...
- Linux 开机启动流程
Linux的开机启动流程 1.开机BIOS自检 --> 检查CPU,硬盘等硬件信息 2.MBR[Major ...
- CentOS(四)--Linux系统的启动级别
对于绝大多数Linux程序员来说,进入Linux系统后一般看到的是黑乎乎的界面(开发模式),因为系统如果启动选择开发模式,会减少启动时间,优化内存等.但是通常我们刚安装完Linux系统,然后进去以后是 ...
- Linux init 0-6 启动级别
原文地址:http://blog.sina.com.cn/s/blog_5f8e8d9801010wlr.html 原文地址:[转]Linux init 0-6 启动级别作者:流水清风 init 0- ...
- Linux学习笔记之Linux启动级别
对于绝大多数Linux程序员来说,进入Linux系统后一般看到的是黑乎乎的界面(开发模式),因为系统如果启动选择开发模式,会减少启动时间,优化内存等.但是通常我们刚安装完Linux系统,然后进去以后是 ...
- Linux的运行级别和设置开机启动服务的方式
Linux的运行级别 什么是运行级别呢?简单点来说,运行级别就是操作系统当前正在运行的功能级别.级别是从0到6,具有不同的功能.这些级别定义在/ect/inittab文件中.这个文件是init程序寻找 ...
- linux开机启动及运行级别、root密码丢失、单用户模式只读的处理方法
linux系统启动大致步骤如下: 加电自检-->根据BIOS中的设置从指定的设备启动-->找到设备MBR中的bootloader引导启动系统-->启动kernel-->启动i ...
- 『学了就忘』Linux启动引导与修复 — 68、Linux系统运行级别
目录 1.Linux系统运行级别介绍 2.查看运行级别 3.修改当前系统的运行级别 4.系统默认运行级别 5./etc/rc.d/rc.local文件说明 1.Linux系统运行级别介绍 Linux默 ...
随机推荐
- 开发常用js代码段
// 获取http传递的参数export const getRequest = ()=>{ var url = location.search; //获取url中"?"符后的 ...
- java String转Long两种方法区别
第一种:包装类型:Byte,Integer,Short,Long,Boolean,Character,Float,Double等8种 Long.valueOf("String")返 ...
- 牛客比赛-状压dp
链接:https://www.nowcoder.com/acm/contest/74/F来源:牛客网 德玛西亚是一个实力雄厚.奉公守法的国家,有着功勋卓著的光荣军史. 这里非常重视正义.荣耀.职责的意 ...
- Selenium-xapth定位
xpath 的定位方法, 非常强大. 使用这种方法几乎可以定位到页面上的任意元素. 什么是xpath xpath 是XML Path的简称, 由于HTML文档本身就是一个标准的XML页面,所以我们可 ...
- 【爬虫】beautiful soup笔记(待填坑)
Beautiful Soup是一个第三方的网页解析的模块.其遵循的接口为Document Tree,将网页解析成为一个树形结构. 其使用步骤如下: 1.创建对象:根据网页的文档字符串 2.搜索节点:名 ...
- 移植 MIUI Framework
移植MIUI Framework 原文:http://www.miui.com/thread-409543-1-1.html 1. 为什么使用代码插桩 首先我们来回顾第一章中的Android软件架构图 ...
- 4.CRT远程连接的使用
目录: 1.为什么需要远程连接? 2.一般的远程连接工具有哪些? 3.远程连接的原理? 4.远程连接的软件的功能和使用相关技巧? 1.为什么选择远程连接? 因为在实际工作中,机房一般都不可能在办公室, ...
- rem第一天
Rem为单位 CSS3的出现,他同时引进了一些新的单位,包括我们今天所说的rem.在W3C官网上是这样描述rem的——“font size of the root element” .下面我们就一起来 ...
- [QT][转载] Qt信号和槽
From: http://blog.csdn.net/rl529014/article/details/51346955 GUI 程序除了要绘制控件,还要响应系统和用户事件,例如重绘.绘制完成.点击鼠 ...
- struts2逻辑视图类型汇总与解释(转)
在struts2框架中,当action处理完之后,就应该向用户返回结果信息,该任务被分为两部分:结果类型和结果本身. 结果类型提供了返回给用户信息类型的实现细节.结果类型通常在Struts2中就已预定 ...