系统运行级别有0~6共7个运行级别

转载地址:https://blog.csdn.net/it1988888/article/details/8051657

系统运行级别有0~6共7个运行级别:

[cpp]  view plain  copy
  1. # Default runlevel. The runlevels used are:  
  2. #   0 - halt (Do NOT set initdefault to this)  
  3. #   1 - Single user mode  
  4. #   2 - Multiuser, without NFS (The same as 3, if you do not have networking)  
  5. #   3 - Full multiuser mode  
  6. #   4 - unused  
  7. #   5 - X11  
  8. #   6 - reboot (Do NOT set initdefault to this)  
  9.   
  10. id:5:initdefault:  

#0 ——停机(不能使用)

#1——单用户模式

#2——多用户模式,但是没有NFS

#3——完全多用户模式

#4——没有使用

#5——图形界面模式

#6——重启模式(不能使用)

id:5:initdefault(运行模式设置)。

那么,init进程就会读取这个系统运行级别设置,然后运行/etc/rc.d/rc脚本。

通过这个脚本,然后进入rcx.d。启动相应的程序。其中rcx.d为/etc/rc.d/rcx.d(x为对应的系统运行级别)

/etc/rc.d/rcx.d/下的文件均为符号链接,最终绝大部分都是都是链接到/etc/rc.d/init.d下面。

到这里,我们可以知道,/etc/rc.d/init.d目录下面的都是开启启动脚本文件,用来启动相应的程序。

猜你喜欢

转载自blog.csdn.net/kunkliu/article/details/80834831