Erlang:守护进程“init.d”脚本无法启动
我有一个管理 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
要以与系统相同的方式手动运行脚本,请使用
service daemon start
如果您有该命令,或者尝试强制脚本在已知的最小环境中运行,就像启动时一样。
To manually run the script the same way the system does, use
service daemon start
if you have that command, or else tryThat forces the script to run with a known, minimal environment just like it would at startup.
感谢您的回答 - 我在启动时启动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.