zoukankan      html  css  js  c++  java
  • Linux inittab 配置文件

    一、声明

        本人实验的环境是 Centos 6.5.

    二、介绍

        在Linux系统中,进程号为1的程序是init,init进程是所有进程的起点并且管理所有进程。

        init进程在运行时会调用/etc/inittab配置文件,inittab文件描述了几种不同的init进程运行级别。

    三、文件内容

    # 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:5:initdefault:
    

        从文件内容可以发现,总共有6个不同的运行级别(runlevel),并且通过类似 id:5:initdefault: 的命令来指定init进程运行的不同级别。

    四、功能

        下面详细说明不同级别对应的效果:

        0 - init进程关闭所有进程并且终止系统。

        1 - 使系统切换到单用户模式且只能允许管理员进入。

        2 - 使系统进入多用户模式,但是不能够网络共享文件。(这和在没有网络情境下的模式3是一样的)

        3 - 完整的多用户模式,最为常用。

        4 - 很少使用。

        5 - 使用X WINSOWS终端(图形界面)。

        6 - 关闭所有进程并重启系统。

        将系统由图形界面模式切换到命令行模式的方法:

        将 id:5:initdefault: 改成 id:3:initdefault: 。

  • 相关阅读:
    【Python】小技巧
    【Python】内置函数清单
    【Python】序列的方法
    【Python】异常处理
    【Python】函数的参数对应
    【Python】函数对象
    redhat7安装jdk1.7报错/home/renqiwei/jdk1.7/bin/java: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory
    redhat更换yum源
    python3降级为python2(linux)
    centos安装apt命令
  • 原文地址:https://www.cnblogs.com/chenshi/p/3988840.html
Copyright © 2011-2022 走看看