Ubuntu下添加開機啓動

1.將你的啓動jupyter.sh腳本複製到 /etc/init.d目錄下
2.設置腳本執行權限

sudo chmod 755 /etc/init.d/jupyter.sh

3.將腳本放到啓動腳本中去

$ cd /etc/init.d
$ sudo update-rc.d jupyter.sh defaults 100
  1. 在jupyter.sh腳本中添加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

5.重啓機器

reboot

卸載啓動腳本的方法:

$ cd /etc/init.d
$ sudo update-rc.d -f jupyter.sh remove
發佈了53 篇原創文章 · 獲贊 8 · 訪問量 10萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章