Terminating application during startup
Wed Mar 22 14:22:44 CET 2006
Then let your application recognize that it cannot start,
print out an error message and call erlang:halt(N) with an appropriate
error code N.
start(normal, [foo]) ->
io:format("Cannot start due to whatever~n", ),
% erl -boot my -noshell
Cannot start due to whatever
Fredrik Thulin wrote:
> On Wednesday 22 March 2006 10:42, Gunilla Arendt wrote:
>> This bug is fixed in OTP R11B.
>> I'm not quite sure what you mean with "terminating nicely". If you
>> mean that you want the node to survive even if an application fails
>> to start, set the type of the application to transient in the .rel
> I'm using Erlang to write a SIP-server that I want to make work like
> most other server softwares people are used to, so that it can be used
> without any knowledge about Erlang, beam, Mnesia and so on, just
> regular system administration skills.
> In my opinion, this means that if certain fatal errors occur during
> startup, the Erlang VM (whole node) should terminate with
> * a nice and understandable error message on standard output
> * a non-zero exit status so that people can start the server from a
> shellscript and know if it failed or succeeded.
> Also, the generation of erl_crash.dump should be avoided when I (as
> programmer) don't think it is needed (for example, the server could be
> started in a just-test-the-config-syntax mode).
More information about the erlang-questions