歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux編程 >> SHELL編程 >> Linux系統中加入自定義Shell為系統服務

Linux系統中加入自定義Shell為系統服務

日期:2017/3/2 16:48:11   编辑:SHELL編程

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

Copyright © Linux教程網 All Rights Reserved