希望能在開機時自動執行 python 的簡易 web 服務
編輯 /etc/shell名稱
#!/bin/bash
### BEGIN INIT INFO
# Provides: startPythonWeb
# Required-Start:
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Python Web Start
# Description: Python Web Start
### END INIT INFO
/usr/bin/python /apps/myPythonProject/manage.py runserver myIp:myPort &
其中### BEGIN INIT INFO 到 ### END INIT INFO 是系統要求必要的說明
然後執行
update-rc.d shell名稱 defaults
系統會把相關配置作好
因為 Default-Start: 2 3 4 5
所以會在 rc2.d/ rc3.d/ rc4.d/ rc5.d/ 底下建立 S 開頭的 soft link
因為 Default-Stop: 0 1 6
所以會在 rc0.d/ rc1.d/ rc6.d/ 底下建立 K 開頭的 soft link
反而預計應該有用的 rcS.d 都沒有效用