Skip to content

Commit

Permalink
Avoid starting rabbitmq processes as root
Browse files Browse the repository at this point in the history
Rabbitmq-plugins must be run as root
(in order to set /etc/rabbitmq/enabled_plugins), but as
a consequence, it starts empd and leaves it running.
This can be worked around by starting epmd as rabbitmq
user before evaluating any plugins.
  • Loading branch information
mattymo committed Oct 13, 2015
1 parent b7e3817 commit 5a86458
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,15 @@
}
}

# Start epmd as rabbitmq so it doesn't run as root when installing plugins
exec { 'epmd_daemon':
command => 'epmd -daemon',
path => '/bin:/sbin:/usr/bin:/usr/sbin',
user => $rabbitmq_user,
group => $rabbitmq_group,
unless => 'pgrep epmd',
}

if $admin_enable and $service_manage {
include '::rabbitmq::install::rabbitmqadmin'

Expand Down Expand Up @@ -238,6 +247,7 @@
-> Class['::rabbitmq::management'] -> Anchor['rabbitmq::end']

# Make sure the various providers have their requirements in place.
Class['::rabbitmq::install'] -> Rabbitmq_plugin<| |>
Class['::rabbitmq::install'] -> Exec['epmd_daemon']
-> Rabbitmq_plugin<| |>

}

0 comments on commit 5a86458

Please sign in to comment.