[erlang-questions] Distributed Applications: Stop Before Start?

Tim Watson <>
Wed Mar 28 15:04:10 CEST 2012


On 28 March 2012 12:40, Vance Shipley <> wrote:
> On Tue, Mar 27, 2012 at 08:15:17AM -0700, Ulf Wiger wrote:
> }  Ok, then one thing that can be done is to create a 'wrapper application'
> }  that starts snmp as an included app.
> }
> }  Your start function would have to call the appropriate function in snmp,
> }  since included apps are not automatically started by OTP.
> }
> }  We used to do this at AXD 301, in order to ensure that applications using
> }  snmp did a takeover in synch with snmp itself.
>
> Ulf,
>
> A couple things about this concern me;
>
>        /Users/otpuser/lib/erlang/doc/design_principles/included_applications.html
>
>  "the top supervisor of the included application must be started by a
>   supervisor in the including application"
>
> The snmp:start/0,1 snmp:start_agent/0,1 and application:start/1,2 functions
> don't behave as a supervisor requires.  There is an appropriate start
> function in snmpa_supervisor:start_master_sup/1 however then the snmp
> application is not listed with application:which_applications/0.
>
>  "This means that when running, an included application is in fact part
>   of the primary application and a process in an included application
>   will consider itself belonging to the primary application."
>
> So if a process in the snmp application would call application:get_all_env/0
> it wouldn't get what it expects.  It does look like all the calls to the
> application module do include the application name (snmp) however.
>
>

Is calling application:load(snmp) prior to starting the top level
supervisor the 'right way' to resolve this issue when working with
included_applications?

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



More information about the erlang-questions mailing list