docker - Erlang: rebar3 release, start beam first? -


i trying utilize new feature in 19.3 per question: erlang: application behavior trap sigterm?

my understanding sending sigterm beam triggers graceful shutdown in erlang 19.3+

i start application in docker using entrypoint ./_build/default/rel/myapp/bin/myapp ./_build/default/rel/myapp/bin/myapp generated rebar3 release

when in docker, myapp gets pid1 , beam seems gets pid.

is there different set of commands can run such beam gets pid1 , myapp gets loaded there? like

./start_beam; ./start_my_app_via_beam?

i need because docker stop sends sigterm pid1. need beam. using above entrypoint, here happens in container": top pid user pr ni virt res shr s %cpu %mem time+ command 1 root 20 0 4340 644 556 s 0.0 0.0 0:00.01 myapp 14 root 20 0 3751188 50812 6660 s 0.0 0.6 0:00.48 beam.smp 18 root 20 0 11492 116 0 s 0.0 0.0 0:00.00 epmd 31 root 20 0 4220 680 604 s 0.0 0.0 0:00.10 erl_child_setup 53 root 20 0 11456 944 840 s 0.0 0.0 0:00.00 inet_gethost 54 root 20 0 17764 1660 1504 s 0.0 0.0 0:00.00 inet_gethost 55 root 20 0 20252 3208 2720 s 0.0 0.0 0:00.02 bash 61 root 20 0 21956 2468 2052 r 0.0 0.0 0:00.00 top

currently, around this, have horrendous beast:

#!/usr/bin/env bash echo "if testing locally send sigterm $$"  term_handler() {   echo "stopping erlang vm gracefully"   #/usr/local/cellar/erlang/19.1/lib/erlang/lib/erl_interface- 3.9.1/bin/erl_call -c myapp -s -a 'init stop' -n 'myapp@localhost'   /usr/local/lib/erlang/lib/erl_interface-3.9.2/bin/erl_call -c myapp -s -a 'init stop' -n 'myapp@localhost'   echo "erlang vm stopped" }  trap term_handler sigquit sigint sigterm  ./_build/default/rel/myapp/bin/myapp &  pid=$!  echo "erlang vm started" #wait $pid while kill -0 $pid ; wait $pid ; exit_status=$? ; done echo "exiting wrapper." exit $exit_status ```  , `entrypoint : ["./thisscript"]` 

this beast becomes pid 1, , finds correct thing kill after that.

i'm trying rid of script.


Comments

Popular posts from this blog

javascript - Create a stacked percentage column -

Optimising Firebase database by automatically overwriting data -

javascript - Angular UI-Grid customTemplate directive causing rows to load slowly/? -