Linux的七个启动级别详解(rc0 - rc6)

简介

linux 系统启动级别分为以下七种:

  • rc0: 停机(不能使用)
  • rc1: 单用户模式
  • rc2: 多用户模式,但是没有NFS
  • rc3: 完全多用户模式
  • rc4: 没有使用,系统预留
  • rc5: 图形界面模式
  • rc6: 重启模式(不能使用)

示例

此处以debian系为例,在/etc/rc0.d/etc/rc6.d七个目录中分别存放了不同的启动脚本,如/etc/rc1.d

lrwxrwxrwx 1 root root  20 Feb  9 10:33 K01alsa-utils -> ../init.d/alsa-utils
lrwxrwxrwx 1 root root  13 Feb  9 10:33 K01atd -> ../init.d/atd
lrwxrwxrwx 1 root root  22 Feb  9 10:33 K02avahi-daemon -> ../init.d/avahi-daemon
lrwxrwxrwx 1 root root  14 Feb  9 10:33 K02gdm3 -> ../init.d/gdm3
lrwxrwxrwx 1 root root  17 Feb  9 10:33 K04rsyslog -> ../init.d/rsyslog
lrwxrwxrwx 1 root root  20 Feb  9 10:33 K06nfs-common -> ../init.d/nfs-common
lrwxrwxrwx 1 root root  17 Feb  9 10:33 K06rpcbind -> ../init.d/rpcbind
lrwxrwxrwx 1 root root  14 Feb  9 10:33 S01motd -> ../init.d/motd
lrwxrwxrwx 1 root root  18 Feb  9 10:33 S05bootlogs -> ../init.d/bootlogs
lrwxrwxrwx 1 root root  16 Feb  9 10:33 S06single -> ../init.d/single

从命名来看,这些脚本分为两类:KXXSXX
其中K代表Kill,是停止的意思,S代表Start,是启动的意思;

紧跟在后面的数字是优先级,数字越大,优先级越低;

这些脚本都是从/etc/init.d目录下软链接过来的,配置文件通常在/etc/init/目录下,个别文件在/etc/下有单独的配置文件目录;

猜你喜欢

转载自blog.csdn.net/lpw_cn/article/details/85028853