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

Pass a HOME environment variable to all rabbitmq execute blocks #352

Merged
merged 1 commit into from
Mar 8, 2016

Conversation

hartmantis
Copy link
Contributor

I ran into #334 today when rolling some new Rabbitmq servers. Since the ShellOuts are already ensuring the presence of a HOME environment variable, it seemed logical to have the execute blocks do the same. Agree/disagree/thoughts?

Thanks!

@jjasghar
Copy link
Contributor

jjasghar commented Mar 2, 2016

Looks good to me.

Just need another 👍

@@ -51,6 +51,7 @@ def parameter_exists?(vhost, name)

execute "set_parameter #{parameter}" do
command cmd
environment 'HOME' => ENV.fetch('HOME', '/root')
Copy link
Member

Choose a reason for hiding this comment

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

Wouldn't /var/lib/rabbitmq be a better fallback value?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If so, should I change it to that in the places where /root was already being set as well?

Copy link
Member

Choose a reason for hiding this comment

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

I think so. RabbitMQ or its CLI tools are typically do not run as root. Granted, /var/lib/rabbitmq isn't portable but it's the most sensible fallback value I can come up with.

@hartmantis hartmantis force-pushed the jdh-execute-env-home branch from 25ef1d0 to fb7a13e Compare March 3, 2016 18:21
@hartmantis
Copy link
Contributor Author

At @michaelklishin's suggestion, updated all the fallback home dirs to /var/lib/rabbitmq.

jjasghar pushed a commit that referenced this pull request Mar 8, 2016
Pass a HOME environment variable to all rabbitmq execute blocks
@jjasghar jjasghar merged commit f4d8da4 into rabbitmq:master Mar 8, 2016
@hartmantis hartmantis deleted the jdh-execute-env-home branch March 8, 2016 18:04
iramello added a commit to iramello/rabbitmq that referenced this pull request Apr 4, 2016
…e-env-home"

This reverts commit f4d8da4, reversing
changes made to 2dc1ba9.
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.

3 participants