]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: create a separate logrotate file for radosgw
authorYehuda Sadeh <yehuda@inktank.com>
Thu, 17 Jan 2013 21:06:14 +0000 (13:06 -0800)
committerGary Lowell <glowell@inktank.com>
Tue, 5 Feb 2013 22:54:38 +0000 (14:54 -0800)
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>
ceph.spec.in
debian/rules
src/rgw/logrotate.conf [new file with mode: 0644]
src/rgw/rgw_main.cc

index a701abddf3c0826c2cf66bf6c8340972dbdf9c3f..c66382339325dab30847aaf095dc65016c58efdd 100644 (file)
@@ -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*
index d35186402cdf942bcb99ac74f2a7b74617874ec8..3ca901f418f7aa2c324b2ffba5275debd1e3b62a 100755 (executable)
@@ -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 (file)
index 0000000..d34f0d2
--- /dev/null
@@ -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
+}
index 3165ab0454ada2136d562b4fcad9b827898f2841..2f18aa4cdc1d9ba8cbb5e7f61fcaad068782f78a 100644 (file)
@@ -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);