summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYehuda Sadeh <yehuda@inktank.com>2013-01-17 13:06:14 -0800
committerGary Lowell <glowell@inktank.com>2013-02-05 14:54:38 -0800
commitc8eace6ff0bbb38bf317b9db2ffba57c3d128693 (patch)
treeecf466aa717195d4715365707f6b7ae02dc2bbbc
parente2e1de2720cf0dd15a9eae4bd503c6cc3f443421 (diff)
downloadceph-c8eace6ff0bbb38bf317b9db2ffba57c3d128693.tar.gz
rgw: create a separate logrotate file for radosgw
Fixes: #3813 Since radosgw package is separate from the ceph package, it also needs to have a separate logrotate. The default path for radosgw log is changed to /var/log/radosgw, and it now has a different logrotate script. Updating both deb and rpm packaging. Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
-rw-r--r--ceph.spec.in2
-rwxr-xr-xdebian/rules3
-rw-r--r--src/rgw/logrotate.conf14
-rw-r--r--src/rgw/rgw_main.cc1
4 files changed, 19 insertions, 1 deletions
diff --git a/ceph.spec.in b/ceph.spec.in
index a701abddf3c..c6638233932 100644
--- a/ceph.spec.in
+++ b/ceph.spec.in
@@ -285,6 +285,7 @@ mkdir -p $RPM_BUILD_ROOT/usr/sbin
ln -sf ../../etc/init.d/ceph %{buildroot}/usr/sbin/rcceph
ln -sf ../../etc/init.d/ceph-radosgw %{buildroot}/usr/sbin/rcceph-radosgw
install -m 0644 -D src/logrotate.conf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/ceph
+install -m 0644 -D src/rgw/logrotate.conf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/radosgw
chmod 0644 $RPM_BUILD_ROOT%{_docdir}/ceph/sample.ceph.conf
chmod 0644 $RPM_BUILD_ROOT%{_docdir}/ceph/sample.fetch_config
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/lib/ceph/tmp/
@@ -359,6 +360,7 @@ fi
%config %{_sysconfdir}/bash_completion.d/radosgw-admin
%config %{_sysconfdir}/bash_completion.d/rbd
%config(noreplace) %{_sysconfdir}/logrotate.d/ceph
+%config(noreplace) %{_sysconfdir}/logrotate.d/radosgw
%{_mandir}/man8/ceph-mon.8*
%{_mandir}/man8/ceph-mds.8*
%{_mandir}/man8/ceph-osd.8*
diff --git a/debian/rules b/debian/rules
index d35186402cd..3ca901f418f 100755
--- a/debian/rules
+++ b/debian/rules
@@ -64,6 +64,7 @@ build-stamp: configure-stamp
cp src/init-ceph debian/ceph.init
cp src/init-radosgw debian/radosgw.init
cp src/logrotate.conf debian/ceph.logrotate
+ cp src/rgw/logrotate.conf debian/radosgw.logrotate
touch $@
@@ -77,7 +78,7 @@ clean:
ltmain.sh missing
rm -f configure Makefile.in man/Makefile.in src/Makefile.in
rm -f src/acconfig.h.in
- rm -f debian/ceph.init debian/radosgw.init debian/ceph.logrotate
+ rm -f debian/ceph.init debian/radosgw.init debian/ceph.logrotate debian/radosgw.logrotate
dh_clean
diff --git a/src/rgw/logrotate.conf b/src/rgw/logrotate.conf
new file mode 100644
index 00000000000..d34f0d2dd59
--- /dev/null
+++ b/src/rgw/logrotate.conf
@@ -0,0 +1,14 @@
+/var/log/radosgw/*.log {
+ rotate 7
+ daily
+ compress
+ sharedscripts
+ postrotate
+ if which invoke-rc.d > /dev/null && [ -x `which invoke-rc.d` ]; then
+ invoke-rc.d radosgw reload >/dev/null
+ elif which service > /dev/null && [ -x `which service` ]; then
+ service radosgw reload >/dev/null
+ fi
+ endscript
+ missingok
+}
diff --git a/src/rgw/rgw_main.cc b/src/rgw/rgw_main.cc
index 3165ab0454a..2f18aa4cdc1 100644
--- a/src/rgw/rgw_main.cc
+++ b/src/rgw/rgw_main.cc
@@ -389,6 +389,7 @@ int main(int argc, const char **argv)
vector<const char *> def_args;
def_args.push_back("--debug-rgw=20");
def_args.push_back("--keyring=$rgw_data/keyring");
+ def_args.push_back("--log-file=/var/log/radosgw/$cluster-$name");
vector<const char*> args;
argv_to_vec(argc, argv, args);