Ubuntu,Python 脚本,如何在启动后运行并使用 update-rc.d
我在 /etc/init.d/test.py 中有一个 python 脚本。我想运行这个脚本,并且需要网络访问,因为我是从 github 克隆的。
所以...我对使用这个命令感到困惑:
sudo update-rc.d test.py start NN rl
我假设我想要运行级别 3? hte NN是什么?本质上, update-rc.d 行应该是什么样子?我希望它最后在启动时使用。这是应该运行的最后一个脚本。
谢谢
I have a python script in /etc/init.d/test.py. I want to run this script and network access is required since I clone from github.
So...I am confused about using this command:
sudo update-rc.d test.py start NN rl
I assume I want run level 3? What is hte NN? In essence, should the update-rc.d line look like? I would like it last on bootup. That is the last script that should be run.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
NN是你想要的数字前缀;要在 statrup 序列末尾附近加载,请使用尽可能高的数字 99。使用
defaults
而不是start
并硬编码运行级别 3 以获得合理的交互式脚本。进一步参见 http://manpages.ubuntu.com/manpages /oneiric/man8/update-rc.d.8.html理想情况下,您的脚本应该具有用于确定其依赖项的标头;那么就可以尽快运行它,即当它的依赖关系得到满足时。再次阅读手册页以获取指针。
The NN is the numeric prefix you want; to load near the end of the statrup sequence, use the highest possible number, 99. Use
defaults
instead ofstart
and hard-coding runlevel 3 for a reasonable interactive script. See further http://manpages.ubuntu.com/manpages/oneiric/man8/update-rc.d.8.htmlIdeally, your script should have the headers for determining its dependencies; then it will be possible to run it as soon as possible, i.e. when its dependencies are satisfied. Again, read the man page for pointers.