[erlang-questions] net_kernel:start without writing cookie file?

Roger Lipscombe roger@REDACTED
Tue Jul 10 17:13:18 CEST 2018


When you start distribution with (e.g.) net_kernel:start([foo,
shortnames]), Erlang writes ~/.erlang.cookie as the current user, with
mode 600.

If you inadvertently use sudo to run your escript, it creates the
.erlang.cookie file owned by root. The next time you run your escript
without sudo (because it wasn't needed), Erlang dies with a
scary-looking error message.

Since our particular escript immediately calls erlang:set_cookie, it's
kinda pointless generating the cookie file.

Is there any way to disable this behaviour, so that people who
accidentally use 'sudo' don't get caught out?

Thanks,
Roger.



More information about the erlang-questions mailing list