diff options
author | Hubert Plociniczak <hubert@lshift.net> | 2008-08-13 11:44:00 +0100 |
---|---|---|
committer | Hubert Plociniczak <hubert@lshift.net> | 2008-08-13 11:44:00 +0100 |
commit | 78b49db227e7e11b42cf1a02a533aa3a96fef564 (patch) | |
tree | ce6c2f8ef4cbc3751ce01b75f40646186a48a8f9 | |
parent | 53e01ba00a7706da871e3f1a2852208930b4db83 (diff) | |
download | rabbitmq-server-78b49db227e7e11b42cf1a02a533aa3a96fef564.tar.gz |
Added logrotate script to debian and rpm packages
-rw-r--r-- | packaging/RPMS/Fedora/Makefile | 1 | ||||
-rw-r--r-- | packaging/RPMS/Fedora/rabbitmq-server.logrotate | 19 | ||||
-rw-r--r-- | packaging/RPMS/Fedora/rabbitmq-server.spec | 8 | ||||
-rw-r--r-- | packaging/debs/Debian/debian/control | 2 | ||||
-rw-r--r-- | packaging/debs/Debian/debian/dirs | 1 | ||||
-rw-r--r-- | packaging/debs/Debian/debian/rabbitmq-server.logrotate | 19 | ||||
-rw-r--r-- | packaging/debs/Debian/debian/rules | 1 |
7 files changed, 48 insertions, 3 deletions
diff --git a/packaging/RPMS/Fedora/Makefile b/packaging/RPMS/Fedora/Makefile index c8e979a7..6cc3579b 100644 --- a/packaging/RPMS/Fedora/Makefile +++ b/packaging/RPMS/Fedora/Makefile @@ -21,6 +21,7 @@ prepare: cp $(TOP_DIR)/rabbitmq-server.spec $(TOP_DIR)/SPECS cp $(TOP_DIR)/init.d $(TOP_DIR)/BUILD cp $(TOP_DIR)/rabbitmqctl_wrapper $(TOP_DIR)/BUILD + cp $(TOP_DIR)/rabbitmq-server.logrotate $(TOP_DIR)/BUILD server: prepare rpmbuild -ba $(TOP_DIR)/SPECS/rabbitmq-server.spec $(DEFINES) --target noarch diff --git a/packaging/RPMS/Fedora/rabbitmq-server.logrotate b/packaging/RPMS/Fedora/rabbitmq-server.logrotate new file mode 100644 index 00000000..002adfdc --- /dev/null +++ b/packaging/RPMS/Fedora/rabbitmq-server.logrotate @@ -0,0 +1,19 @@ +/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 { + weekly + missingok + rotate 10 + compress + delaycompress + notifempty + create 644 rabbitmq rabbitmq +} diff --git a/packaging/RPMS/Fedora/rabbitmq-server.spec b/packaging/RPMS/Fedora/rabbitmq-server.spec index d1a70e88..4e39012c 100644 --- a/packaging/RPMS/Fedora/rabbitmq-server.spec +++ b/packaging/RPMS/Fedora/rabbitmq-server.spec @@ -6,7 +6,7 @@ Group: Development/Libraries Source: http://www.rabbitmq.com/releases/rabbitmq-server/v%{main_version}/%{name}-%{main_version}.tar.gz URL: http://www.rabbitmq.com/ Vendor: LShift Ltd., Cohesive Financial Technologies LLC., Rabbit Technlogies Ltd. -Requires: erlang +Requires: erlang, logrotate Packager: Hubert Plociniczak <hubert@lshift.net> BuildRoot: %{_tmppath}/%{name}-%{main_version}-%{release}-root Summary: The RabbitMQ server @@ -60,6 +60,9 @@ chmod 0755 %{buildroot}/usr/sbin/rabbitmqctl cp %{buildroot}%{_mandir}/man1/rabbitmqctl.1.gz %{buildroot}%{_mandir}/man1/rabbitmqctl_real.1.gz +mkdir -p %{buildroot}/etc/logrotate.d +cp ../rabbitmq-server.logrotate %{buildroot}/etc/logrotate.d/rabbitmq-server + %post # create rabbitmq group if ! getent group rabbitmq >/dev/null; then @@ -80,7 +83,7 @@ chown -R rabbitmq:rabbitmq /var/log/rabbitmq %preun if [ $1 = 0 ]; then #Complete uninstall - /sbin/service rabbitmq-server stop + /sbin/service rabbitmq-server stop > /dev/null 2>&1 /sbin/chkconfig --del rabbitmq-server # We do not remove /var/log and /var/lib directories @@ -101,6 +104,7 @@ fi /var/lib/rabbitmq/ /var/log/rabbitmq/ /etc/rc.d/init.d/rabbitmq-server +%config(noreplace) /etc/logrotate.d/rabbitmq-server %clean rm -rf %{buildroot} diff --git a/packaging/debs/Debian/debian/control b/packaging/debs/Debian/debian/control index ae698e1e..0696eca7 100644 --- a/packaging/debs/Debian/debian/control +++ b/packaging/debs/Debian/debian/control @@ -7,7 +7,7 @@ Standards-Version: 3.7.2 Package: rabbitmq-server Architecture: all -Depends: erlang-nox, adduser +Depends: erlang-nox, adduser, logrotate Description: An AMQP server written in Erlang RabbitMQ is an implementation of AMQP, the emerging standard for high performance enterprise messaging. The RabbitMQ server is a robust and diff --git a/packaging/debs/Debian/debian/dirs b/packaging/debs/Debian/debian/dirs index 48db317f..1b15b0c3 100644 --- a/packaging/debs/Debian/debian/dirs +++ b/packaging/debs/Debian/debian/dirs @@ -4,4 +4,5 @@ usr/share/man usr/share/linda/overrides var/lib/rabbitmq/mnesia var/log/rabbitmq +etc/logrotate.d diff --git a/packaging/debs/Debian/debian/rabbitmq-server.logrotate b/packaging/debs/Debian/debian/rabbitmq-server.logrotate new file mode 100644 index 00000000..002adfdc --- /dev/null +++ b/packaging/debs/Debian/debian/rabbitmq-server.logrotate @@ -0,0 +1,19 @@ +/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 { + weekly + missingok + rotate 10 + compress + delaycompress + notifempty + create 644 rabbitmq rabbitmq +} diff --git a/packaging/debs/Debian/debian/rules b/packaging/debs/Debian/debian/rules index e230aec5..606bbfd1 100644 --- a/packaging/debs/Debian/debian/rules +++ b/packaging/debs/Debian/debian/rules @@ -14,6 +14,7 @@ install/rabbitmq-server:: rm $(RABBIT_LIB)/LICENSE* mv $(DEB_DESTDIR)usr/sbin/rabbitmqctl $(DEB_DESTDIR)usr/sbin/rabbitmqctl_real cp debian/rabbitmqctl_wrapper $(DEB_DESTDIR)usr/sbin/rabbitmqctl + cp debian/rabbitmq-server.logrotate $(DEB_DESTDIR)etc/logrotate.d/rabbitmq-server cp $(DEB_DESTDIR)usr/share/man/man1/rabbitmqctl.1.gz $(DEB_DESTDIR)usr/share/man/man1/rabbitmqctl_real.1.gz chmod a+x $(DEB_DESTDIR)usr/sbin/rabbitmqctl echo "Tag: usr-lib-in-arch-all" > $(DEB_DESTDIR)usr/share/linda/overrides/rabbitmq-server |