您的位置:首页 > 运维架构 > Linux

Linux系统运行级别

2016-03-18 10:13 561 查看
一、Linux系统有7个运行级别(runlevel),分别是运行级别0---6运行级别

(1)运行级别0:系统停机状态,系统默认运行级别不能设为0,否则不能正常启动。其实就是关机。

(2)运行级别1:单用户工作状态,root权限,用于系统维护,禁止远程登陆.在忘记root密码时一般用这个运行级别,进去修改root密码。

(3)运行级别2:多用户状态(没有NFS),没有网络连接。

(4)运行级别3:完全的多用户状态(有NFS),登陆后进入控制台命令行模式。 linux很常见的运行级别

(5)运行级别4:系统未使用,保留。

(6)运行级别5:X11控制台,登陆后进入图形GUI模式。就是图形模式。

(7)运行级别6:系统正常关闭并重启,默认运行级别不能设为6,否则不能正常启动。

二、linux系统运行级别只能在一种runlevel下运行。如下所示:
[root@nginx ~]# cat /etc/inittab
# inittab is only used by upstart for the default runlevel.
#
# ADDING OTHER CONFIGURATION HERE WILL HAVE NO EFFECT ON YOUR SYSTEM.
#
# System initialization is started by /etc/init/rcS.conf
#
# Individual runlevels are started by /etc/init/rc.conf
#
# Ctrl-Alt-Delete is handled by /etc/init/control-alt-delete.conf
#
# Terminal gettys are handled by /etc/init/tty.conf and /etc/init/serial.conf,
# with configuration in /etc/sysconfig/init.
#
# For information on how to write upstart event handlers, or how
# upstart works, see init(5), init(8), and initctl(8).
#
# Default runlevel. The runlevels used are:
# 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)
#
id:3:initdefault: #######3这里默认为3,一般使用图形模式的话要修改为5.
[root@nginx ~]#

本文出自 “山猫” 博客,请务必保留此出处http://cqtangbo.blog.51cto.com/2978612/1752421
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: