rebar3 project spawns wrong command on other hosts

69 Views Asked by At

I have a rebar3 project. In this project, the supervisor should spawn a bunch of Erlang nodes across multiple machines. I found that the nodes were never getting brought up because of an error in the log:

sh: no such file or directory h/mberns01/..../prod

Where only the leading slash of the path is missing and the rest of the command is correct.

Where in this project is this command generated and why might it be missing the leading slash? I'm not even sure what other information I can provide here to be helpful -- let me know.

Cheers.

EDIT: So it looks like init:get_argument(progname) returns the wrong program (no leading /). Not sure why...

2

There are 2 best solutions below

2
Roman Rabinovich On

init:get_argument(progname) is supposed to return {ok,[["name"]]} not a directory, so no leading /

Also, out of curiosity, how are you spawning new nodes? Are you using slave, pool or something else? If slave, what arguments are you passing it?

0
tekknolagi On

It appears as though the problem can be sidestepped by using slave:start/5, which allows the user to specify what Prog they want to run on the remote host:

spawn(slave, start, [Host, 'node', [], self(), "erl"])

But it does not answer the question of why there is a missing /.