Linux中加入自定義shell爲系統服務

Red Hat 自帶的Apache和PHP有點怪, 所以卸載了

重新源代碼安裝好了Apache+PHP之後感覺少了開機自動啓動有點不爽,

直接加入到啓動腳本里也不是太好

所以..

1. [root@localhost ~]# cp /usr/local/apache2/bin/apachectl  /etc/init.d/httpd

2. [root@localhost ~]# vi /etc/init.d/httpd

3. 在第二行加入 (必須,否則無法加入)

    # chkconfig: 2345 85 15
    # description: httpd is web server(此處爲描述).

   說明:2345表示在2345這四種啓動級別裏面加載這個服務, 85表示啓動(開機時)順序號,15表示關閉(關機時)順序號.

4. [root@localhost ~]# chkconfig --add httpd

5. [root@localhost ~]#  chkconfig --level 35 httpd on

就這樣OK 啦

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章