<% if p("rabbitmq-server.restart_statsdb_cron_schedule") %>
tmpfile=$(mktemp)
echo 'PATH=/usr/bin:/bin:/var/vcap/packages/erlang/bin:/var/vcap/packages/rabbitmq-server/bin' > "${tmpfile}"
echo '<%= p("rabbitmq-server.restart_statsdb_cron_schedule") %> vcap /var/vcap/packages/rabbitmq-server/bin/rabbitmqctl eval "supervisor2:terminate_child(rabbit_mgmt_sup_sup, rabbit_mgmt_sup),rabbit_mgmt_sup_sup:start_child()."' >> "${tmpfile}"
cp "${tmpfile}" "/etc/cron.d/rabbitmq-statsdb-reset"
<% end %>

<% if_p("rabbitmq-server.restart_statsdb_cron_schedule") do |schedule| %>
tmpfile=$(mktemp)
echo 'PATH=/usr/bin:/bin:/var/vcap/packages/erlang/bin:/var/vcap/packages/rabbitmq-server/bin' > "${tmpfile}"
echo '<%= schedule %> vcap /var/vcap/packages/rabbitmq-server/bin/rabbitmqctl eval "supervisor2:terminate_child(rabbit_mgmt_sup_sup, rabbit_mgmt_sup),rabbit_mgmt_sup_sup:start_child()."' >> "${tmpfile}"
cp "${tmpfile}" "/etc/cron.d/rabbitmq-statsdb-reset"
<% end %>

Make the statsdb restart schedule optional
Make the statsdb restart schedule optional

[#136577519]

Signed-off-by: Carlo Colombo <38c9d5db9f6d6f5bb8266b73fcdee56a5a2fe4dc@pivotal.io>
