[erlang-questions] Why I cannot start sasl from my app file application specification

Ivan Carmenates García co7eb@REDACTED
Fri Aug 16 04:27:14 CEST 2013


Hi Fred,

Thanks, the best solution I came with for now is to start it manually from
start/2 callback function, because I have the Erlang R16B and I don't have
that new function implemented. I think that's nice to have another function
like ensure_all_started/1-2 in the application module, that makes the entire
application to be started as one or fail as one if the applications
specified in the app file couldn’t be all started property.

But I still think even when the normal application:start/1-2 function don’t
required all the child applications to be started, still that, I think it
should do start the sasl application, because I think there is no apparent
reason why it should not to.

Another last thing, and I am sorry to bother you, there is a way to turn off
the intromission of the error_logger in the sasl reports?, because I have
repeated the same error when happens, one in the sasl like form:

CRASH REPORT  <0.35.0>                                      2013-08-15
21:43:07
============================================================================
===
Crashing process

   initial_call
         {application_master,init,
                            ['Argument__1','Argument__2','Argument__3',
                             'Argument__4']}
   pid
<0.35.0>
   registered_name
[]
   error_info
         {exit,
            {bad_return,
                {{countlink,start,[normal,[{debug_level,all_solid}]]},
                 {'EXIT',
                     {undef,
...
...

and another with the error_logger form:

INFO REPORT  <0.7.0>                                        2013-08-15
21:43:07
============================================================================
===
application
countlink
exited
         {bad_return,
            {{countlink,start,[normal,[{debug_level,all_solid}]]},
             {'EXIT',
                 {undef,

Both reports of the same error but different error_loggers in the same sasl
report.

I also tried to silent the error_logger with: {kernel, [{error_logger,
silent}]}  but still...


Regards,
Ivan.


 

-----Mensaje original-----
De: Fred Hebert [mailto:mononcqc@REDACTED] 
Enviado el: jueves, 15 de agosto de 2013 16:23
Para: Ivan Carmenates García
CC: erlang-questions@REDACTED
Asunto: Re: [erlang-questions] Why I cannot start sasl from my app file
application specification

That's because unless you do -boot sasl, start SASL manually (with
application:start/2) or have it started as part of a release, the SASL
application is not actually started, and all the config file does is define
variables to be loaded once it's started.

If everything went fine with one of the patches I sent the OTP team,
R16B02 should see the addition of application:ensure_all_started/1-2
functions that will boot both the application and all of its dependencies,
recursively. This will make your use case simpler.

Regards,
Fred.

On 08/15, Ivan Carmenates García wrote:
> Hi all,
> 
>  
> 
> I have this application specification for an application.
> 
>  
> 
> {application, x,
> 
> [{description,                   "x description"},
> 
>   {vsn, "1.0"},
> 
>   {modules, [x, x_sup, x_log]},
> 
>   {registered, [x, x_sup, x_log]},
> 
>   {applications, [kernel, stdlib, sasl]},
> 
>   {mod, {x, []}},
> 
>   {start_phases,                []}]}.
> 
>  
> 
> Then when I try to start the system I get this error.
> 
>  
> 
> application:start(x).
> 
>   {error,{not_started,sasl}
> 
>  
> 
> I also have this config file which I load with werl -config x.config
> 
>  
> 
>  
> 
> [{sasl, [
> 
>                 {sasl_error_logger, {file, "debug2.log"}},
> 
>                 {errlog_type, error},
> 
>                 %% define the parameters of the rotating log
> 
>                 %% the log file directory
> 
>                 {error_logger_mf_dir, "d:/WORK/x-1.0/error_logs/"},
> 
>                 %% # bytes per logfile
> 
>                 {error_logger_mf_maxbytes, 10485760}, % 10 MB
> 
>                 %% maximum number of logfiles
> 
>                 {error_logger_mf_maxfiles, 10}]},
> 
> {kernel, [
> 
>                 {error_logger, {file, "debug.log" }}]}
> 
> ].
> 
>  
> 
> If I start the sasl whether by hand in the console like this
> application:start(sasl) or by the command line werl -boot start_sasl 
  
> all work fine.
> 
> But not from the normal application specification which should be 
> started from there according to the documentation.
> 
>  
> 
> Best regards,
> 
> Ivan.
> 
>  
> 

> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions




More information about the erlang-questions mailing list