加入收藏 | 设为首页 | 会员中心 | 我要投稿 温州站长网 (https://www.0577zz.com/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 服务器 > 搭建环境 > Linux > 正文

linux开机自启动设置inittab详解

发布时间:2016-09-21 23:19:56 所属栏目:Linux 来源:站长网
导读:linux下的/etc/inittab中的英文解释: This file describes how the INIT process should set up the system in a certain run-level.The inittab file describe

linux下的/etc/inittab中的英文解释:

This file describes how the INIT process should set up  the system in a certain run-level.The inittab file describes which processes are started  at  bootup  and      during  normal operation.

通俗的说就是控制linux启动时的一些程序及级别。

run-level的英文解释:

# Default runlevel. The runlevels used by RHS 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)

将上面翻译过来就是:

# 0 - 停机(千万不能把initdefault 设置为0 )

# 1 - 单用户模式  

# 2 - 多用户,没有 NFS  (没有网络)

# 3 - 完全多用户模式(标准的运行级,实际上就是text模式)  

# 4 - 没有用到  

# 5 - X11 (xwindow)  

# 6 - 重新启动

在inittab文件里所有的有效语句都遵守如下格式:

id:runlevels:action:process

id:是标识名,可以任意起名,4个字符以内,要注意的是标识名不能重复,它是唯一的。

runlevels:表示这一行适用于运行那些级别(如上所示的6个级别);另外sysinit、boot、bootwait这三个进程会忽略这个设置值。此项可以多选,比如要运行1,2,3个级别,就写成123

action:表示进入对应的runlevels时,init应该运行process字段的命令的方式,常用的字段值及解释在附录内。

respawn:表示init应该监视这个进程,即使其结束后也应该被重新启动。

wait:   init应该运行这个进程一次,并等待其结束后再进行下一步操作。

once:   init需要运行这个进程一次。

boot:   随系统启动运行,所以runlevel值对其无效。

bootwait:随系统启动运行,并且init应该等待其结束。

off:     没有任何意义。

(编辑:温州站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    热点阅读