Ubuntu,Python 脚本,如何在启动后运行并使用 update-rc.d

发布于 2025-01-02 09:43:01 字数 268 浏览 1 评论 0原文

我在 /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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

对你再特殊 2025-01-09 09:43:01

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 of start and hard-coding runlevel 3 for a reasonable interactive script. See further http://manpages.ubuntu.com/manpages/oneiric/man8/update-rc.d.8.html

Ideally, 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文