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

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