This repository has been archived by the owner on Jun 26, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid starting rabbitmq server as root
Starting rabbitmq-server causes rabbitmq (and dependent processes) to start as root user, causing undesirable results. epmd process stays running as root until killed by OCF scripts. It is more desirable to start rabbitmq manually when Puppet tells it to. Additionally, rabbitmq-plugins must be run as root (in order to set /etc/rabbitmq/enabled_plugins), but as a consequence, it starts epmd and leaves it running. This can be worked around by starting epmd as rabbitmq user before evaluating any plugins. Added test for ensuring all RabbitMQ related processes are running as rabbitmq user. Upstream proposed change: voxpupuli/puppet-rabbitmq#403 Change-Id: Ia6e5392c9d16d1be0ea166a61402d2103c5d4453 Closes-Bug: #1483249
- Loading branch information
Showing
5 changed files
with
43 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
deployment/puppet/osnailyfacter/modular/rabbitmq/rabbitmq_post.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
require File.join File.dirname(__FILE__), '../test_common.rb' | ||
|
||
RABBITMQ_USER="rabbitmq" | ||
|
||
class RabbitMQPostTest < Test::Unit::TestCase | ||
|
||
def test_rabbitmq_is_running | ||
assert TestCommon::Process.running?('/usr/sbin/rabbitmq-server'), 'RabbitMQ is not running!' | ||
end | ||
|
||
def test_rabbitmq_running_as_rabbitmq_user | ||
cmd = 'ps haxo user,cmd | egrep -v "su |grep "| egrep "rabbitmq|beam|epmd" | egrep -v "^' RABBITMQ_USER '"' | ||
assert TestCommon::Process.run_successful?(cmd), "'#{cmd}' returns processes not running as #{RABBITMQ_USER}'" | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters