summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHubert Plociniczak <hubert@lshift.net>2008-08-14 17:58:19 +0100
committerHubert Plociniczak <hubert@lshift.net>2008-08-14 17:58:19 +0100
commit6641d07f5f867847c80521c22d2c080bebab759b (patch)
treeb408d76d2bf0ab74c0d27e266f1cebdc4a87e8d1
parente3e91d0b93e77f2baf8d649bed442212ea727c0d (diff)
downloadrabbitmq-server-6641d07f5f867847c80521c22d2c080bebab759b.tar.gz
Use postrotate script to reopen logs and
sharedscripts option in logrotate. Removed .bak mechanism from linux/unix distros.
-rw-r--r--packaging/RPMS/Fedora/rabbitmq-server.logrotate18
-rw-r--r--packaging/debs/Debian/debian/rabbitmq-server.logrotate18
-rwxr-xr-xscripts/rabbitmq-server4
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\""