An introduction to the /etc/init.d directory
来源:互联网 发布:聚合数据app 编辑:程序博客网 时间:2024/06/05 16:37
If you use Linux you most likely have heard of the init.d directory. But what exactly does this directory do? It ultimately does one thing but it does that one thing for your entire system, so init.d is very important. The init.d directory contains a number of start/stop scripts for various services on your system. Everything from acpid to x11-common is controlled from this directory. Of course it's not exactly that simple.
If you look at the /etc directory you will find directories that are in the form rc#.d (Where # is a number reflects a specific initialization level - from 0 to 6). Within each of these directories is a number of other scripts that control processes. These scripts will either begin with a "K" or an "S". All "K" scripts are run before "S" scripts. And depending upon where the scripts are located will determine when the scripts initiate. Between the directories the system services work together like a well-oiled machine. But there are times when you need to start or stop a process cleanly and without using the kill or killall commands. That is where the /etc/init.d directory comes in handy.
In order to control any of the scripts in init.d manually you have to have root (or sudo) access. Each script will be run as a command and the structure of the command will look like: /etc/init.d/command OPTION . Where command is the actual command to run and OPTION can be one of the following:
- start
- stop
- reload
- restart
- force-reload
About /etc/rc.local script. This file runs after all other init level scripts have run, so it's safe to put various commands that you want to have issued upon startup.
转自:https://www.ghacks.net/2009/04/04/get-to-know-linux-the-etcinitd-directory/
- An introduction to the /etc/init.d directory
- Get To Know Linux: The /etc/init.d Directory
- An Introduction to the JAIN SIP API
- An Introduction to the Extended Kalman Filter
- An Introduction to the Theory of Computation
- an-introduction-to-the-raphael-js-librar
- An Introduction to the Raphael JS Library
- /etc/init.d/gdm
- /etc/init.d/functions
- /etc/init.d
- /etc/init.d目录
- /etc/init.d/mysql: No such file or directory 和 ERROR 2002 (HY000): Can't connect to local MySQL server through socket 解决办法
- 第一部分:An Introduction to 3D Rendering
- can't run '/etc/init.d/rcS': No such file or directory 最终解决方法
- nginx运行文件出错env: /etc/init.d/nginx: No such file or directory
- 解决:cant't run '/etc/init.d/rcS':No such file or directory
- nginx运行文件出错env: /etc/init.d/nginx: No such file or directory
- can't run '/etc/init.d/rcS': No such file or directory解决方法
- php变量类型转换的原理
- 纯css制作 虾
- 欧拉路·一
- 使用简单的URDF模型文件结合ros小车实现同步运动
- HNUST 1522: 爱心苹果
- An introduction to the /etc/init.d directory
- 从零开始开发一款Android App
- JS面试题—原型和原型链
- AngularJS 深入理解 $scope
- 使用J2SE API读取Properties文件的六种方法
- 关于pandas.DataFrame的groupby的用法
- python 处理telnet返回的More,以及get想要的那个参数
- 新手 HB辅助入门教程 (环境安装)一
- AVR——使用定时器必须弄清的几个概念