centos 開機自啓設定:

在sentos系統下,主要有兩種方法設置本身安裝的程序開機啓動。
一、把啓動程序的命令添加到/etc/rc.d/rc.local文件中,好比下面的是設置開機啓動httpdlinux

  1. #!/bin/sh
  2. #
  3. # This script will be executed *after* all the other init scripts.
  4. # You can put your own initialization stuff in here if you don't
  5. # want to do the full Sys V style init stuff.
  6.  
  7. touch /var/lock/subsys/local
  8. /usr/local/apache/bin/apachectl start

二、把寫好的啓動腳本添加到目錄/etc/rc.d/init.d/,而後使用命令chkconfig設置開機啓動。
例如:咱們把httpd的腳本寫好後放進/etc/rc.d/init.d/目錄,使用apache

  1. chkconfig --add httpd
  2. chkconfig httpd on

命令即設置好了開機啓動。centos

相關文章
相關標籤/搜索