Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First "daemon" startup hangs if no cookie is specified #905

Open
weiss opened this issue Feb 15, 2022 · 2 comments
Open

First "daemon" startup hangs if no cookie is specified #905

weiss opened this issue Feb 15, 2022 · 2 comments

Comments

@weiss
Copy link
Contributor

weiss commented Feb 15, 2022

If no ~/.erlang.cookie file exists and -setcookie isn't specified, using the extended start script's daemon command will hang forever waiting for RPC to work, as erl_rpc is called without a cookie being handed over to the -c flag. (This happens with OTP 23+, but not when using nodetool.)

Not quite sure of the best way to address this. Maybe just assume that using the extended start script implies RPC, so rather than warning about a missing cookie, just create a cookie file early on (and abort if this fails)? I mean the VM will attempt to create the file anyway, unless -(s)name is omitted.

(Kinda related to #803, where I'd like to avoid using erl_rpc's -c flag if a cookie file exists.)

@tsloughter
Copy link
Member

To make sure I understand, you are relying on the fact the VM creates a cookie on boot if none is given and no ~/.erlang.cookie file exists? But since that file isn't created until boot it isn't available to be put on a variable COOKIE and passed to erl_rpc?

I think the fix is to check if COOKIE is empty before line 332 and to not pass -c if it is -- erl_call will read ~/.erlang.cookie in that case.

@weiss
Copy link
Contributor Author

weiss commented Feb 15, 2022

To make sure I understand, you are relying on the fact the VM creates a cookie on boot if none is given and no ~/.erlang.cookie file exists? But since that file isn't created until boot it isn't available to be put on a variable COOKIE and passed to erl_rpc?

Yes to both.

I think the fix is to check if COOKIE is empty before line 332 and to not pass -c if it is -- erl_call will read ~/.erlang.cookie in that case.

Ah yes, that might do the trick.

weiss added a commit to processone/eturnal that referenced this issue Jul 21, 2022
On Erlang/OTP 23 and newer, the very first "eturnalctl daemon" startup
hangs due to a missing Erlang cookie file.  Work around this issue until
it's fixed:

erlware/relx#905
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants