引导脚本终止并给出错误(不存在错误记录器)
我制作了一个 Erlang 应用程序,它将在操作系统启动时启动。启动脚本存储在/etc/init.d 中。它看起来像这样:
#!/bin/sh
cd $ROOT/lib/di
INET_ADDR=$(ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}')
NODE_NAME=$(echo di@$INET_ADDR)
erl -pa $PWD/ebin -pa $PWD/deps/*/ebin -name $NODE_NAME -boot di $1 -setcookie agfeo
该脚本尝试确定计算机的 IP 地址,以便为节点提供唯一的名称。当机器启动时,脚本会自动执行。在终端上,我得到以下输出:
(no error logger present) error: "Error in process <0.1.0> with exit value:
{badarg,[{erlang,list_to_atom,[[<<2 bytes>>,<<5 bytes>>,46,98,111,111,116]]},
{init,get_boot,2},{init,do_boot,3}]}"
{"init terminating in do_boot",{badarg,[{erlang,list_to_atom,[[<<2 bytes>>,<<5 bytes>>,46,98,111,111,116]]},
{init,get_boot,2},{init,do_boot,3}]}}
init terminating in do_boot ()
这是自动加载脚本时 shell 打印出来的内容。 当我手动调用脚本时,我的应用程序正常启动,没有任何问题。
有人可以解释一下上面的错误消息是什么意思吗?
I made an Erlang application, that shall be started on booting of the operating system. The boot script is stored in /etc/init.d. It looks like this:
#!/bin/sh
cd $ROOT/lib/di
INET_ADDR=$(ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}')
NODE_NAME=$(echo di@$INET_ADDR)
erl -pa $PWD/ebin -pa $PWD/deps/*/ebin -name $NODE_NAME -boot di $1 -setcookie agfeo
The script tries to determine the IP address of the machine, in order to give the node an unique name. When the machine boots, the script gets executed automatically. On the terminal I get the following output:
(no error logger present) error: "Error in process <0.1.0> with exit value:
{badarg,[{erlang,list_to_atom,[[<<2 bytes>>,<<5 bytes>>,46,98,111,111,116]]},
{init,get_boot,2},{init,do_boot,3}]}"
{"init terminating in do_boot",{badarg,[{erlang,list_to_atom,[[<<2 bytes>>,<<5 bytes>>,46,98,111,111,116]]},
{init,get_boot,2},{init,do_boot,3}]}}
init terminating in do_boot ()
This is what the shell prints out, when the script is loaded automatically.
When I call the script manually, my application gets started normally, without any problems.
Could anybody please explain, what the error message above means?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果我们查看堆栈跟踪,则执行的最后一个函数是 init:get_boot/2 ,最后一条指令是
erlang:list_to_atom([<<2 bytes>>, <<5 bytes>>, ".boot"])< /代码>。在
init:get_boot/2
中有三行带有list_to_atom
,因此错误应该是以下之一:我认为错误是“无法获取启动文件”。
If we look at the stack trace the last function executed is init:get_boot/2 and the last instruction is
erlang:list_to_atom([<<2 bytes>>, <<5 bytes>>, ".boot"])
. In theinit:get_boot/2
there are three lines withlist_to_atom
, so error should be one of the following:I believe the error is 'cannot get bootfile'.