From 4d2c30c4aa187cfc21a7ecfa29b1c9893d305400 Mon Sep 17 00:00:00 2001 From: Josh Durgin Date: Wed, 19 Mar 2014 03:32:07 -0700 Subject: [PATCH] packaging: add logrotate config There's no need to signal running agents since they use a WatchedFileHandler that detects rotation itself. Signed-off-by: Josh Durgin --- debian/rules | 4 ++++ logrotate.conf | 6 ++++++ radosgw-agent.spec | 2 ++ 3 files changed, 12 insertions(+) create mode 100644 logrotate.conf diff --git a/debian/rules b/debian/rules index 7d2e9dd..c9449ea 100755 --- a/debian/rules +++ b/debian/rules @@ -6,6 +6,10 @@ export DH_VERBOSE=1 %: dh $@ --buildsystem python_distutils --with python2 +override_dh_installlogrotate: + cp logrotate.conf debian/radosgw-agent.logrotate + dh_installlogrotate + override_dh_installinit: install -d -m0755 debian/radosgw-agent/etc/init install -m0644 init-radosgw-agent debian/radosgw-agent/etc/init diff --git a/logrotate.conf b/logrotate.conf new file mode 100644 index 0000000..7be94e4 --- /dev/null +++ b/logrotate.conf @@ -0,0 +1,6 @@ +/var/log/ceph/radosgw-agent/*.log { + rotate 7 + daily + compress + missingok +} diff --git a/radosgw-agent.spec b/radosgw-agent.spec index 3113611..8485525 100644 --- a/radosgw-agent.spec +++ b/radosgw-agent.spec @@ -34,6 +34,7 @@ install -D init-radosgw-agent $RPM_BUILD_ROOT%{_initrddir}/radosgw-agent %install python setup.py install --single-version-externally-managed -O1 --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES +install -m 0644 -D logrotate.conf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/radosgw-agent %clean rm -rf $RPM_BUILD_ROOT @@ -43,3 +44,4 @@ rm -rf $RPM_BUILD_ROOT %dir %{_sysconfdir}/ceph/radosgw-agent/ %dir %{_localstatedir}/log/ceph/radosgw-agent/ %dir %{_localstatedir}/run/ceph/radosgw-agent/ +%config(noreplace) %{_sysconfdir}/logrotate.d/radosgw-agent -- 2.47.3