ubuntu16 start

ubuntu 16.04中一定要加上以下LSB信息,不然放入啓動腳本的時候會報錯無法開機啓動。

#!/bin/sh
### BEGIN INIT INFO
# Provides:          svnd.sh
# Required-start:    $local_fs $remote_fs $network $syslog
# Required-Stop:     $local_fs $remote_fs $network $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: starts the svnd.sh daemon
# Description:       starts svnd.sh using start-stop-daemon
### END INIT INFO

sudo chmod 755 /etc/init.d/svnd.sh (注意一定要設置權限,不然開機不會啓動)

$ cd /etc/init.d

 $ sudo update-rc.d svnd.sh defaults 95

 注:其中數字95是腳本啓動的順序號,按照自己的需要相應修改即可。在你有多個啓動腳本,而它們之間又有先後啓動的依賴關係時你就知道這個數字的具體作用了。

卸載啓動腳本的方法:

 $ cd /etc/init.d

$ sudo update-rc.d -f svnd.sh remove

 

geng xin ubuntu16 yuan https://blog.csdn.net/maizousidemao/article/details/79127695

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