How to stop an Application

Ulf Wiger <>
Tue Jan 7 10:42:43 CET 2003


On Mon, 6 Jan 2003, Suresh S wrote:

>Hi ,
>
>This is the start module of my aplicaiton,
>there r two call back functions start and stop
>
>So can i use stop function (i.e entry_app:stop([])
>from an other module) to stop this applicaiton

The way to stop the application would be

application:stop(entry_app).

(or whatever the actual application is called, if it`s not
`entry_app`)

The application controller will call the entry_app:stop/1
function to allow for e.g. some cleanup procedures to
execute.

Similarly, you use application:start(entry_app) to start the
application. Depending on what you want to see happen if an
application crashes, you could use either

application:start(entry_app, permanent)

(which means the node will terminate if your application
crashes)

or

application:start(entry_app, temporary)

(which means the node will stay up.)

In the entry_app.app file, you need to insert a `mod`
attribute like so:

{mod, {entry_app, []}}

([] will work fine, since your entry_app module doesn`t care
about the args anyway.)

/Uffe


>i am calling stop function but it is not working
>what parameter i have to pass to this stop function
>inorder to stop the application from an other module.
>
>-module(entry_app).
>-behaviour(application).
>-export([start/2,stop/1]).
>
>start(Type, _Args) ->
>    io:format("In Application Start Module.~n"),
>    entry_sup:start_link().
>
>stop(S) ->
>    ok.
>
>Thanks in advace
>
>suresh s
>
>________________________________________________________________________
>Missed your favourite TV serial last night? Try the new, Yahoo! TV.
>       visit http://in.tv.yahoo.com
>

-- 
Ulf Wiger, Senior Specialist,
   / / /   Architecture & Design of Carrier-Class Software
  / / /    Strategic Product & System Management
 / / /     Ericsson Telecom AB, ATM Multiservice Networks




More information about the erlang-questions mailing list