$erl
Erlang R13B01 (erts-5.7.2) [source] [smp:2:2] [rq:2] [async-threads:0] [hipe] [kernel-poll:false]
Eshell V5.7.2 (abort with ^G)
1> myserver:start_link().
<ok, some_pid>
一切都很顺利,我能够从其他模块调用服务器。
现在,我需要持续地将其作为服务器运行,并遇到了erl_call函数。所以现在我这样做:
erl_call -d -s -a 'myserver start_link' -sname myserver_node
但是,服务器启动后会自动关闭。我启用了-d标志以查看出了什么问题。这是在调试跟踪文件中看到的:
===== Log started ======
Fri Oct 2 04:42:32 2009
erl_call: sh -c exec erl -noinput -sname myserver_node -s erl_reply reply 174.143.175.70 42457 5882
=ERROR REPORT==== 2-Oct-2009::04:44:05 ===
** Generic server myserver terminating
** Last message in was {'EXIT',<0.59.0>,normal}
** When Server state == {20499,24596,28693,32790,36887,40984,45081}
** Reason for termination ==
** {function_clause,[{myserver,terminate,
[normal,
{20499,24596,28693,32790,36887,40984,45081}]},
{gen_server,terminate,6},
{proc_lib,init_p_do_apply,3}]}
有没有想法是什么原因导致服务器自动关闭?跟踪甚至显示终止原因是正常的。但我没有发起终止。