whitfin / local-cluster

Easy local cluster creation for Elixir to aid in unit testing
MIT License
226 stars 30 forks source link

Crashes with certain cookies #10

Closed narrowtux closed 5 years ago

narrowtux commented 5 years ago

Some systems generate cookies that have special characters in them, this trips the shell when supplying that cookie with the -setcookie option.

For example, I have the cookie 0mwHxf/~5h{?|pm<ST1PCtean_Be~bT9386.5O9!RL2s5=[YkPLCew%^@[A&CO^x, and shell outputs these errors:

sh: ST1PCtean_Be~bT9386.5O9!RL2s5=[YkPLCew%^@[A: No such file or directory
sh: CO^x: command not found

This is easily fixed by wrapping the cookie with quotes.

whitfin commented 5 years ago

@narrowtux unless I’m mistaken, this has nothing to do with this library and it’s simply shell giving you that error, right? There’s nothing to fix here.

narrowtux commented 5 years ago

No, that's what happens when calling :slave.start_link in line 50.

I was able to fix it by wrapping the cookie with ":

-       '-loader inet -hosts 127.0.0.1 -setcookie #{:erlang.get_cookie()}'
+       '-loader inet -hosts 127.0.0.1 -setcookie "#{:erlang.get_cookie()}"'
whitfin commented 5 years ago

@narrowtux you got it, fixed in https://github.com/whitfin/local-cluster/commit/8ea8a8e92d753ba41bb1b0e0e39dab21e618c719 and will be in v1.1.0