歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> 關於Linux >> Linux添加系統服務小程序

Linux添加系統服務小程序

日期:2017/3/1 13:58:01   编辑:關於Linux
Linux添加系統服務小程序
Python代碼 如何增加一個服務: 1.服務腳本必須存放在/etc/ini.d/目錄下; 2.chkconfig --add servicename 在chkconfig工具服務列表中增加此服務,此時服務會被在/etc/rc.d/rcN.d中賦予K/S入口了; 3.chkconfig --level 35 mysqld on 修改服務的默認啟動等級。 1 在/usr/bin 目錄下添加hello.sh 文件 echo "hello" 2 添加到/etc/rc.d/init.d/文件夾之下 文件名sayhello #!/bin/bash /usr/bin/hello.sh 3 在rc5.d做一個相應的軟連接 ln -s /etc/rc.d/init.d/sayhello /etc/rc5.d/Ssayhello@
Copyright © Linux教程網 All Rights Reserved