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

Introduce ad-hoc Erlang cookie configuration for the dev scripts #4445

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

pgj
Copy link
Contributor

@pgj pgj commented Feb 25, 2023

Extend the dev/run and dev/remsh scripts in ways that would let the users to set the cookie for inter-node communication directly from the command line. This may come handy in certain cases, e.g. when there is a specific Clouseau instance to hook up.

Extend the `dev/run` and `dev/remsh` scripts in ways that would
let the users to set the cookie for inter-node communication
directly from the command line.  This may come handy in certain
cases, e.g. when there is a specific Clouseau instance to hook up.
@pgj pgj force-pushed the feature/parametric-erlang-cookie branch from 432f154 to b6540b6 Compare February 25, 2023 01:00
@@ -38,8 +38,7 @@
{{node_name}}

# All nodes must share the same magic cookie for distributed Erlang to work.
# Uncomment the following line and append a securely generated random value.
# -setcookie
{{erlang_cookie}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,

can this change break "couchdb-pkg" somewhere, if we are maybe grepping for "-setcookie"? @rnewson

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have not worked with couchdb-pkg before but I can verify this concern there.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jan for the references.

Copy link
Member

@rnewson rnewson Aug 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The package scripts should be (needs to be) robust against this kind of thing and I believe they are.

If the commented-out setcookie line is no longer present after this change the packaging scripts will append a setcookie line to the end of the file. That's less tidy than it being where we planned for it to be, but it will still work.

I would, however, prefer for this change not to have unintended side-effects at all.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed.

if [ -n "$COOKIE" ]; then
_cookie_flag="-setcookie $COOKIE"
else
_cookie_flag=""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason for the else clause when empty is the default?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, there is not any :-) Thanks for catching this.

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

Successfully merging this pull request may close these issues.

4 participants