Closed MagiCrazy closed 5 years ago
You should just use release_ctl ping --name="$NAME" --cookie="$COOKIE"
, which will return non-zero if the ping fails. require_live_node
is designed specifically to require a thing, i.e. fail if the condition is not met. You can take a look at the ping.sh
script under priv/libexec/commands
for an example.
OK, so we missed something :) Thanks a lot for your time and your work!
Steps to reproduce
here's the
start_app.sh
file:Here's the
rel/commands/connect_mnesia.sh
file:Verbose Logs
Description of issue
We want to launch a command once after the first start of the app. So we don't use boot hooks, just a deploy script that starts our application, then launch a custom command.
As we investigated the issue, we found that the function
require_live_node
fails using a fail function and thatfail function
throws anexit 1
. We think thatrequire_live_node
could throw back areturn 1
instead of anexit 1
, in order to be more easily manageable in command scripts. Or maybe, we missed something and done it the wrong way, but we can't figure it out!If our solution is accepted, we could propose a PR 💪
elixir version: 1.7.2 distillery version: 2.0.12