Erlang:守护进程“init.d”脚本无法启动

发布于 2024-08-05 03:25:52 字数 274 浏览 2 评论 0原文

我有一个管理 Erlang 守护进程的 python 脚本。系统初始化后,通过 shell 使用时一切正常。

现在,当我在“/etc/init.d”下包含相同的脚本并在“/etc/rcX.d”中正确设置符号链接时,python 脚本仍然可以工作但是我的 Erlang 守护进程失败启动并且不留下明显的痕迹(例如 crash_dump、dmesg 等)

我还尝试通过 'erl -env HOME /root' 设置环境变量“HOME”,但仍然没有运气。

有什么线索吗?

I have a python script which manages an Erlang daemon. Everything works fine when used through a shell once the system is initialized.

Now, when I included the same script under "/etc/init.d" and with the symlinks properly set in "/etc/rcX.d", the python script still works but my Erlang daemon fails to start and leaves no discernible traces (e.g. crash_dump, dmesg etc.)

I also tried setting the environment variable "HOME" through 'erl -env HOME /root' and still no luck.

Any clues?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

皇甫轩 2024-08-12 03:25:52

要以与系统相同的方式手动运行脚本,请使用 service daemon start 如果您有该命令,或者尝试

cd /
env -i LANG="$LANG" PATH="$PATH" TERM="$TERM" /etc/init.d/daemon start

强制脚本在已知的最小环境中运行,就像启动时一样。

To manually run the script the same way the system does, use service daemon start if you have that command, or else try

cd /
env -i LANG="$LANG" PATH="$PATH" TERM="$TERM" /etc/init.d/daemon start

That forces the script to run with a known, minimal environment just like it would at startup.

念﹏祤嫣 2024-08-12 03:25:52

感谢您的回答 - 我在启动时启动rabbitmq的“Alice”RESTful接口时遇到了麻烦。关键是在我的初始化脚本中使用“env HOME=/root /path/to/alice/startup/script”。

Thanks for this answer - I was having a devil of a time starting the "Alice" RESTful interface to rabbitmq on startup. The key was using 'env HOME=/root /path/to/alice/startup/script' in my init script.

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