Skip to content

Commit

Permalink
Rotate RabbitMQ logs properly
Browse files Browse the repository at this point in the history
RabbitMQ log rotation requires running a script which uses sudo and TCP
socket connection to EPMD, and RabbitMQ itself just to send a "logs
reload" command.

Signed-off-by: Peter Lemenkov <[email protected]>
  • Loading branch information
lemenkov committed May 26, 2017
1 parent 0e27dd5 commit aade489
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions logrotate.te
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ gen_tunable(logrotate_use_nfs, false)
## </desc>
gen_tunable(logrotate_read_inside_containers, false)

# For running sudo in RabbitMQ if installed
gen_require(`
class passwd rootok;
class passwd passwd;
')

type logrotate_t;
domain_type(logrotate_t)
Expand Down Expand Up @@ -345,6 +350,19 @@ optional_policy(`
')
')

optional_policy(`
epmd_query(logrotate_t)
')

optional_policy(`
# Required for proper logrotation using rabbitmqctl as a post-rotate
# script. See rhbz#1413775 for further details.
rabbitmq_admin(logrotate_t)
selinux_compute_access_vector(logrotate_t)
corenet_tcp_connect_rabbitmq_port(logrotate_t)
allow logrotate_t self:passwd { passwd rootok };
')

#######################################
#
# logrotate_mail local policy
Expand Down

0 comments on commit aade489

Please sign in to comment.