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
Linux系統中加入自定義Shell為系統服務
更新時間: 2008-05-20 14:40:07來源: 粵嵌教育瀏覽量:787