If restaring rsyslog fails, retry
@@ -47,7 +47,25 @@ chown -R vcap:vcap "${HEALTHCHECK_LOG_DIR}"
<% end.else do %>
if [[ -e /etc/rsyslog.d/01-mysql.conf ]]; then
rm -f /etc/rsyslog.d/01-mysql.conf
+
+ attempts=0
+ set +e
/usr/sbin/service rsyslog restart
+
+ # Attempt to restart syslog because of race condition with other releases
+ while [ $? -ne 0 ]; do
+ let attempts=attempts+1
+
+ if [ ${attempts} -ge 10 ]; then
+ echo "Unable to restart rsyslog"
+ exit 1
+ fi
+
+ sleep 5
+ /usr/sbin/service rsyslog restart
+ done
+
+ set -e
fi
<% end %>
