From 6641d07f5f867847c80521c22d2c080bebab759b Mon Sep 17 00:00:00 2001 From: Hubert Plociniczak Date: Thu, 14 Aug 2008 17:58:19 +0100 Subject: Use postrotate script to reopen logs and sharedscripts option in logrotate. Removed .bak mechanism from linux/unix distros. --- packaging/RPMS/Fedora/rabbitmq-server.logrotate | 18 ++++++------------ packaging/debs/Debian/debian/rabbitmq-server.logrotate | 18 ++++++------------ scripts/rabbitmq-server | 4 ---- 3 files changed, 12 insertions(+), 28 deletions(-) diff --git a/packaging/RPMS/Fedora/rabbitmq-server.logrotate b/packaging/RPMS/Fedora/rabbitmq-server.logrotate index 002adfdc..e366f36a 100644 --- a/packaging/RPMS/Fedora/rabbitmq-server.logrotate +++ b/packaging/RPMS/Fedora/rabbitmq-server.logrotate @@ -1,14 +1,4 @@ -/var/log/rabbitmq/*.log { - size=2M - missingok - rotate 10 - compress - delaycompress - notifempty - create 644 rabbitmq rabbitmq -} - -/var/log/rabbitmq/*.log.back /var/log/rabbitmq/*.err { +/var/log/rabbitmq/*.log /var/log/rabbitmq/*.err { weekly missingok rotate 10 @@ -16,4 +6,8 @@ delaycompress notifempty create 644 rabbitmq rabbitmq -} + sharedscripts + postrotate + /usr/sbin/rabbitmqctl reopen_logs + endscript +} \ No newline at end of file diff --git a/packaging/debs/Debian/debian/rabbitmq-server.logrotate b/packaging/debs/Debian/debian/rabbitmq-server.logrotate index 002adfdc..e366f36a 100644 --- a/packaging/debs/Debian/debian/rabbitmq-server.logrotate +++ b/packaging/debs/Debian/debian/rabbitmq-server.logrotate @@ -1,14 +1,4 @@ -/var/log/rabbitmq/*.log { - size=2M - missingok - rotate 10 - compress - delaycompress - notifempty - create 644 rabbitmq rabbitmq -} - -/var/log/rabbitmq/*.log.back /var/log/rabbitmq/*.err { +/var/log/rabbitmq/*.log /var/log/rabbitmq/*.err { weekly missingok rotate 10 @@ -16,4 +6,8 @@ delaycompress notifempty create 644 rabbitmq rabbitmq -} + sharedscripts + postrotate + /usr/sbin/rabbitmqctl reopen_logs + endscript +} \ No newline at end of file diff --git a/scripts/rabbitmq-server b/scripts/rabbitmq-server index a44dd6da..5368c04c 100755 --- a/scripts/rabbitmq-server +++ b/scripts/rabbitmq-server @@ -39,10 +39,6 @@ CLUSTER_CONFIG_FILE=/etc/default/rabbitmq_cluster.config ## Log rotation LOGS="${LOG_BASE}/${NODENAME}.log" SASL_LOGS="${LOG_BASE}/${NODENAME}-sasl.log" -BACKUP_EXTENSION=".bak" - -[ -f "${LOGS}" ] && cat "${LOGS}" >> "${LOGS}${BACKUP_EXTENSION}" -[ -f "${SASL_LOGS}" ] && cat "${SASL_LOGS}" >> "${SASL_LOGS}${BACKUP_EXTENSION}" if [ -f "$CLUSTER_CONFIG_FILE" ]; then CLUSTER_CONFIG="-rabbit cluster_config \"$CLUSTER_CONFIG_FILE\"" -- cgit v1.2.1