I also tried stop/1 in priv/init, it does not work.
But it didn't say the stop/1 will execute when the server stop. It just say 
that "stop is executed if the script is ever reloaded".

在 2014年8月6日星期三UTC+8下午1时38分06秒,mihawk写道:
>
> hi, 
>
> same as init
>
> just implement stop/1 in you module piv/init 
> if it doesn't work just make an issue.
>
> chan
>
>
>
>
>
>
>
>
>
>
>
>
> 2014-08-06 12:51 GMT+08:00 Caiyun Deng <[email protected] <javascript:>
> >:
>
>>  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]> 
>>> 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]. 
>>> > 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] <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/bd266859-2009-46bb-8655-0a91df5595a0%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/chicagoboss/bd266859-2009-46bb-8655-0a91df5595a0%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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/f5b9ee23-79d7-4351-875f-cf003d634e7f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to