我创建了一个自动启动shell脚本。然后我已经允许可执行。
Add a link to /etc/inin.d/ : sudo ln -snf /opt/myapp/apimanager /etc/init.d/apimanager
update-rc.d命令设置运行级别
sudo update-rc.d apimanager defaults
我最终得到以下错误
update-rc.d: warning: /etc/init.d/apimanager missing LSB information
update-rc.d: see <http://wiki.debian.org/LSBInitScripts>
Adding system startup for /etc/init.d/apimanager ...
/etc/rc0.d/K20apimanager -> ../init.d/apimanager
/etc/rc1.d/K20apimanager -> ../init.d/apimanager
/etc/rc6.d/K20apimanager -> ../init.d/apimanager
/etc/rc2.d/S20apimanager -> ../init.d/apimanager
/etc/rc3.d/S20apimanager -> ../init.d/apimanager
/etc/rc4.d/S20apimanager -> ../init.d/apimanager
/etc/rc5.d/S20apimanager -> ../init.d/apimanager
答案 0 :(得分:28)
要消除警告,我们必须按照here所述添加相应的脚本标题。
### BEGIN INIT INFO
# Provides: scriptname
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start daemon at boot time
# Description: Enable service provided by daemon.
### END INIT INFO