CentOS5/6的啟動流程

啟動流程畫了張圖,看著更清晰些: (centos7的啟動流程變化挺大的,這部分待補充)

image.png


補充(/etc/rc.d/rc.local?不屬于任何服務,為特殊文件,可將不能定義為服務又想開機運行的命令定義在此文件中)

?

添加自定義服務:

[root@el5?init.d]#?vi??/etc/init.d/testsrv?

#!/bin/bash

#chkconfig:?223?92?60

#description:??????????????programs?at?periodic?scheduled?times.?vixie?cron?adds?a?\

#??????????????number?of?features?to?the?basic?UNIX?cron,?including?better?\

#??????????????security?and?more?powerful?configuration?options.#

echo?"hello"

?

[root@el5?init.d]#?chkconfig?--add??testsrv

?

[root@el5?init.d]#?service?testsrv

hello