我创建了一个自动启动
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
解决方法
为了摆脱警告,我们必须添加相应的脚本标题,如
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