Linux /etc/rc.d 下面 rc${runlevel}.d rc.local init.d 区别
来源:互联网 发布:北邮人论坛 知乎 编辑:程序博客网 时间:2024/05/28 15:45
一:init.d
init.d 存放的是各种系统跟多服务的开始停止脚本等,/etc/init.d 是 /etc/rc.d/init.d 的软链接。
二:/rc.d/rc${runlevel}.d 这里面也是些脚本,放在这儿的脚本都是根据运行级别来确定的,以K开始的表示STOP 动作,以S开始的表示Start动作
三:rc.local
系统根据运行级别(runlevel)启动完rc${runlevel}.d 里面的脚本时候,就会调用rc.local脚本,无论什么级别都会执行,而不必区分runlevel=3 还是 runlevel=5
例1: 以Apache 为例子,将apachectl 作为一个服务:
cp /usr/local/apache/bin/apachectl /etc/rc.d/init.d/httpd
ln -s /etc/rc.d/init.d/httpd /etc/rc.d/rc3.d/S60httpd (60)代表启动顺序
这时候service httpd start|stop|restart 已经可以生效了,但是chkconfig --list 并没有看到我所添加的httpd服务,那是因为我们还没有把这个服务交给chkconfig来管理,所以chkconfig 还需要添加httpd服务才行,那么怎么加,又有什么要求呢?chkconfig --add httpd, 但是需要httpd的脚本需要有一些必要的信息才行。
# chkconfig: 35 60 60 (35 表示运行级别 3 和 5 第一个60 表示开始启动序号 第二个60表示关闭序号)
# description: Apache
编辑完毕之后,保存。 然后执行 chkconfig --add httpd
然后chkconfig --list 就可以看到httpd了。
例2: 以Apache为例,作为自启动服务
echo "./usr/local/apache/bin/apachectl start" >> /etc/rc.d/rc.local
这样每次重启也可以实现httpd自动。
- Linux /etc/rc.d 下面 rc${runlevel}.d rc.local init.d 区别
- /etc/rc.local 与 /etc/init.d
- Linux文件 /etc/rc.local以及/etc/init.d
- linux /etc/init.d/ rc*.d 详解
- ubuntu下/etc/rc.local和/etc/init.d/rc.local的区别
- 说说/etc/rc.d/rc.local
- 说说/etc/rc.d/rc.local
- Linux系列:Linux下/etc/rc.local与/etc/init.d的区别与联系
- Linux下/etc/rc.local与/etc/init.d的区别与联系
- /etc/rc.d/rc.local 自动加载linux 脚本
- linux中/etc/rc.d/rc.local和/etc/rc.local这两个文件有什么区别
- linux中/etc/rc.d/rc.local和/etc/rc.local这两个文件有什么区别
- 关于/etc/rc.local以及/etc/init.d
- 关于/etc/rc.local以及/etc/init.d
- 关于/etc/rc.local与/etc/init.d
- 关于/etc/rc.local以及/etc/init.d
- 关于/etc/rc.local与/etc/init.d
- 关于/etc/init.d和/etc/rc.local
- Linux下php安装Redis扩展
- Poj2746-Housewife Wind 树链剖分入门(边权)
- Asp.Net页面传值的几种方式
- 《HBase上的交互式SQL查询》Intel 孙元浩
- 0031TCP/IP协议之三次握手图文详解
- Linux /etc/rc.d 下面 rc${runlevel}.d rc.local init.d 区别
- SQL读书笔记(八) 联结表
- 什么是死锁以及死锁的预防、检测与修复
- leetcode:Pow(x, n) 【Java】
- process令牌
- zzuli蓝桥 text1 I 平方和
- Linux的运行级别和chkconfig用法
- [数据结构] 表达式求值(转化为后缀表达式再求值或直接求值)
- 客户端python热更新