Linux 的 init 程序 - 也称为进程控制初始化,负责启动系统启动时需要运行的所有正常和授权的进程。 这些可能包括 APACHE 守护进程、NETWORK 守护进程以及机器启动时必须运行的任何其他程序。 这些进程中的每一个在/etc/rc.d/init.d/目录下都有一个脚本,该脚本被编写为接受一个参数,该参数可以是 start、stop 和 restart。 事实上,您可以使用命令手动执行这些脚本
示例 3-1. 启动和停止各种守护进程
在 Linux 下手动启动 httpd Web 服务器。
[root@deep] /# /etc/rc.d/init.d/httpd start |
启动 httpd:[确定]
在 Linux 下手动停止 httpd Web 服务器。
[root@deep] /# /etc/rc.d/init.d/httpd stop |
正在关闭 http:[确定]
在 Linux 下手动重启 httpd Web 服务器。
[root@deep] /# /etc/rc.d/init.d/httpd restart |
正在关闭 http:[确定] 启动 httpd:[确定]
检查你的/etc/rc.d/init.d/目录以查找可用服务,并使用命令 start | stop | restart 来操作。