Hi! I tried it, I typed "q()" in ./init-dev.sh and "./init.sh stop" in
the production mode, but it does not work.
spawn(fun() -> monitor_stop() end),
monitor_stop() ->
?TRACE_VAR(monitor_stop),
Ref = erlang:monitor(process, boss_sup),
receive
Msg ->
?TRACE_VAR(Msg),
monitor_stop()
end.
在 2014年8月6日星期三UTC+8上午3时02分11秒,Jesse Gumm写道:
>
> There's not currently (As far as I know) a standard way to do that,
> but you could use a monitor to achieve it.
>
> Ref = monitor(process, boss_sup),
> receive
> {'DOWN', _, process, {boss_sup, _}, _} ->
> run_my_other_shutdown_scripts()
> end.
>
> -Jesse
>
> On Mon, Aug 4, 2014 at 4:16 AM, Caiyun Deng <[email protected]
> <javascript:>> wrote:
> > Hi!
> > When i want to do something at the server start, I can do something in
> > priv/init.
> > But when i want to do something at the server stop, How can i do?
> >
> > --
> > You received this message because you are subscribed to the Google
> Groups
> > "ChicagoBoss" group.
> > To unsubscribe from this group and stop receiving emails from it, send
> an
> > email to [email protected] <javascript:>.
> > Visit this group at http://groups.google.com/group/chicagoboss.
> > To view this discussion on the web visit
> >
> https://groups.google.com/d/msgid/chicagoboss/b1c56929-e5ac-4990-ba10-6a3188e49ed2%40googlegroups.com.
>
>
> >
> > For more options, visit https://groups.google.com/d/optout.
>
>
>
> --
> Jesse Gumm
> Owner, Sigma Star Systems
> 414.940.4866 || sigma-star.com || @jessegumm
>
--
You received this message because you are subscribed to the Google Groups
"ChicagoBoss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
Visit this group at http://groups.google.com/group/chicagoboss.
To view this discussion on the web visit
https://groups.google.com/d/msgid/chicagoboss/bd266859-2009-46bb-8655-0a91df5595a0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.