rc0.d rc1.d rc2.d rc3.d rc4.d rc5.d rc6.d rc.local/etc/rc.d文件目录详解
来源:互联网 发布:linux启动oracle实例 编辑:程序博客网 时间:2024/05/20 10:15
控制脚本目录/etc/rc.d,该目录下存在各个运行级别的脚本文件,以下是rhel-server-6.3为例的查询结果:
[root@localhost etc]# cd /etc/rc.d
[root@localhost rc.d]# ls
init.d
[root@localhost rc.d]# cd rc0.d
[root@localhost rc0.d]# ls -l
总用量 0
lrwxrwxrwx. 1 root root 20 9月
lrwxrwxrwx. 1 root root 16 9月
lrwxrwxrwx. 1 root root 22 9月
lrwxrwxrwx. 1 root root 17 9月
lrwxrwxrwx. 1 root root 19 9月
lrwxrwxrwx. 1 root root 15 9月
lrwxrwxrwx. 1 root root 13 9月
lrwxrwxrwx. 1 root root 17 9月
lrwxrwxrwx. 1 root root 14 9月
lrwxrwxrwx. 1 root root 16 9月
lrwxrwxrwx. 1 root root 19 9月
lrwxrwxrwx. 1 root root 15 9月
lrwxrwxrwx. 1 root root 19 9月
lrwxrwxrwx. 1 root root 15 9月
lrwxrwxrwx. 1 root root 19 9月
lrwxrwxrwx. 1 root root 14 9月
lrwxrwxrwx. 1 root root 17 9月
lrwxrwxrwx. 1 root root 24 9月
lrwxrwxrwx. 1 root root 32 9月
lrwxrwxrwx. 1 root root 17 9月
lrwxrwxrwx. 1 root root 20 9月
lrwxrwxrwx. 1 root root 15 9月
lrwxrwxrwx. 1 root root 19 9月
lrwxrwxrwx. 1 root root 16 9月
lrwxrwxrwx. 1 root root 15 9月
lrwxrwxrwx. 1 root root 13 9月
lrwxrwxrwx. 1 root root 20 9月
lrwxrwxrwx. 1 root root 16 9月
lrwxrwxrwx. 1 root root 16 9月
lrwxrwxrwx. 1 root root 15 9月
lrwxrwxrwx. 1 root root 19 9月
lrwxrwxrwx. 1 root root 14 9月
lrwxrwxrwx. 1 root root 15 9月
lrwxrwxrwx. 1 root root 17 9月
lrwxrwxrwx. 1 root root 19 9月
lrwxrwxrwx. 1 root root 19 9月
lrwxrwxrwx. 1 root root 15 9月
lrwxrwxrwx. 1 root root 19 9月
lrwxrwxrwx. 1 root root 17 9月
lrwxrwxrwx. 1 root root 17 9月
lrwxrwxrwx. 1 root root 19 9月
lrwxrwxrwx. 1 root root 24 9月
lrwxrwxrwx. 1 root root 24 9月
lrwxrwxrwx. 1 root root 19 9月
lrwxrwxrwx. 1 root root 20 9月
lrwxrwxrwx. 1 root root 20 9月
lrwxrwxrwx. 1 root root 21 9月
lrwxrwxrwx. 1 root root 17 9月
lrwxrwxrwx. 1 root root 16 9月
lrwxrwxrwx. 1 root root 17 9月
lrwxrwxrwx. 1 root root 14 9月
lrwxrwxrwx. 1 root root 21 9月
lrwxrwxrwx. 1 root root 15 9月
lrwxrwxrwx. 1 root root 17 9月
lrwxrwxrwx. 1 root root 19 9月
lrwxrwxrwx. 1 root root 18 9月
lrwxrwxrwx. 1 root root 19 9月
lrwxrwxrwx. 1 root root 18 9月
lrwxrwxrwx. 1 root root 22 9月
lrwxrwxrwx. 1 root root 14 9月
lrwxrwxrwx. 1 root root 17 9月
lrwxrwxrwx. 1 root root 22 9月
lrwxrwxrwx. 1 root root 17 9月
lrwxrwxrwx. 1 root root 14 9月
以rc0.d目录下的配置文件为例,rc0.d调用了/etc/rc.d/init.d目录下的程序。
说明:
/etc/rc.d/init.d
该文件夹包含所有服务在各个运行等级中的全部启动脚本。一般来说,它们都是标准的shell脚本,遵守最基本的标准。每个脚本最少接受两个参数start和stop,它们分别代表启动和停止服务(如网页服务)。除此之外,init脚本通常还会接受一些额外的选项,如restart(重启服务器)、status(返回服务当前状态)、reload(告知服务从配置文件中重新载入配置)以及force-reload(强制服务重载它的配置)。当用不带参数的方式运行脚本的时候,一般应该返回一个它会接受的参数列表。
/etc/rc.d/rc0.d~/etc/rc.d/rc6.d
这些文件夹分别包含每个运行等级对应的init脚本。在实际使用中,它们一般通过符号链接到/etc/init.d文件夹下的实际文件。不过要注意的是,这些文件夹下的init脚本都有一些特别的名字,命名都以S(start)、K(kill)或D(disable)开头,后面跟一个数字。当init进入一个运行等级的时候,它会按照数字顺序运行所有以K开头的脚本并传入stop参数,除非对应的init脚本在前一个运行等级中没有启动。然后init按照数字顺序运行所有以S开头的脚本并传入start参数。任何以D开头的init脚本都会被忽略—这让你可以在指定的运行等级禁止一个脚本,或者你也可以仅仅移除全部符号链接。所以如果你有两个脚本,S01foo和S05bar,init首先会运行S01foo start,当它进入特定的运行等级后再执行S05bar start。
/etc/rc.d/rc.local
并非所有的发行版都使用了rc.local,通常它是一个留给用户修改的shell脚本。一般会在init进程结束的时候运行它,所以你可以在这里放一些想要运行的额外脚本,而不用再创建自己的init脚本。
/etc/rc.d/rc.sysinit
/etc/rc.d/rc.sysinit主要做在各个运行模式中相同的初始化工作,包括设定PATH、设定网络配置(/etc/sysconfig/network)、启动swap分区、设定/proc等等。
/etc/rc.d/rc
当运行级别改变时,负责启动/停止各种服务。
=====================================================================
注意:这只是启动脚本sh文件,只要脚本运行了,那我就可以在sh脚本里运行各种a.out程序!!!
- rc0.d rc1.d rc2.d rc3.d rc4.d rc5.d rc6.d rc.local/etc/rc.d文件目录详解
- linux系统:init.d rc0.d rc1.d rc2.d rc3.d rc4.d rc5.d rc6.d
- /etc/rc.d文件目录详解
- /etc/rc.d/rc.sysinit 文件详解
- linux /etc/init.d/ rc*.d 详解
- /etc/rc.d目录介绍
- 说说/etc/rc.d/rc.local
- 说说/etc/rc.d/rc.local
- rc.d
- linux /etc/rc.d/目录的详解
- linux /etc/rc.d/目录的详解
- linux /etc/rc.d/目录的详解
- linux /etc/rc.d目录的详解
- linux /etc/rc.d/目录的详解
- linux /etc/rc.d/目录的详解
- Linux /etc/rc.d/目录的详解
- linux /etc/rc.d/目录的详解
- linux /etc/rc.d/目录的详解
- [js点滴]JavaScript基础正则详解03
- 一个很好的浏览器兼容性测试网站
- DS 二叉树实现
- Leetcode||24.Swap Nodes in Pairs
- 数据结构与算法--查找与排序
- rc0.d rc1.d rc2.d rc3.d rc4.d rc5.d rc6.d rc.local/etc/rc.d文件目录详解
- 图像压缩——算术编码
- 自定义View的简单案例(1)
- waitpid
- 排序算法(五)快速排序多种版本
- [C++]C++的流程控制语句
- 嵌入式系统 Cortex-A8处理器编程
- b
- ffmpeg 滤镜及其效果