How to start an iex session with cookie and erl options
Asked Answered
B

1

6

If I start an IEx session in the following manner the cookie is set correctly.

$ iex --name [email protected] --cookie mycookie -S mix
...
iex([email protected])1> :erlang.get_cookie
:mycookie

However if I also set erlang arguments to get use my sys.config file the cookie is not set correctly.

$ iex --name [email protected] --cookie mycookie --erl "config sys.config" -S mix
...
iex([email protected])1> :erlang.get_cookie
:USLOPZLYUPUYMEGXBMJQ

How can I set both a config and cookie as command line arguments?

Brenna answered 1/11, 2016 at 9:58 Comment(0)
B
7

The erlang configuration to set a cookie is setcookie not cookie. Can be solved by starting as follows.

$ iex --name [email protected] --erl "-config sys.config -setcookie mycookie" -S mix
Brenna answered 1/11, 2016 at 10:44 Comment(2)
So --erl overrides --cookie in the first example? Sounds like a bug to me. Elixir should either merge them or disallow specifying both --erl and --cookie.Lethe
agreed. I've started putting all options that work both ways in the --erl arguments to be on the safe sideBrenna

© 2022 - 2024 — McMap. All rights reserved.