summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-02-06 10:38:08 -0800
committerSage Weil <sage@inktank.com>2013-02-06 10:38:08 -0800
commit0aea4dba040b8caaeb5c4079728078541e5bb2c1 (patch)
tree9592d1c551cc1efda7302b6f2fc0ebb7716884c5
parentc0e1070f2f54bcd592a731c9b912669e6c7ca4ee (diff)
parent7f237be2e2a2b855797d9103ac76697a90d7e13f (diff)
downloadceph-0aea4dba040b8caaeb5c4079728078541e5bb2c1.tar.gz
Merge remote-tracking branch 'gh/wip-3768'
-rw-r--r--ceph.spec.in3
-rw-r--r--debian/control2
-rwxr-xr-xdebian/rules3
-rw-r--r--src/Makefile.am1
-rw-r--r--src/logrotate.conf12
-rw-r--r--src/rgw/logrotate.conf24
-rw-r--r--src/rgw/rgw_main.cc1
7 files changed, 36 insertions, 10 deletions
diff --git a/ceph.spec.in b/ceph.spec.in
index 7efb9889a74..c6638233932 100644
--- a/ceph.spec.in
+++ b/ceph.spec.in
@@ -24,7 +24,6 @@ Source0: http://ceph.com/download/%{name}-%{version}.tar.bz2
Requires: librbd1 = %{version}-%{release}
Requires: librados2 = %{version}-%{release}
Requires: libcephfs1 = %{version}-%{release}
-Requires: perl
Requires: python
Requires(post): binutils
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@@ -286,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/
@@ -360,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/control b/debian/control
index 5f71995a932..e79cbbd2292 100644
--- a/debian/control
+++ b/debian/control
@@ -11,7 +11,7 @@ Standards-Version: 3.9.3
Package: ceph
Architecture: linux-any
-Depends: ${shlibs:Depends}, ${misc:Depends}, sdparm | hdparm, binutils, ceph-common, uuid-runtime, python, xfsprogs, perl
+Depends: ${shlibs:Depends}, ${misc:Depends}, sdparm | hdparm, binutils, ceph-common, uuid-runtime, python, xfsprogs
Recommends: ceph-mds, librados2, librbd1, btrfs-tools, gdisk, parted
Description: distributed storage and file system
Ceph is a distributed storage system designed to provide excellent
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/Makefile.am b/src/Makefile.am
index 04234229236..6a9bb147824 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1871,6 +1871,7 @@ noinst_HEADERS = \
osdc/WritebackHandler.h\
perfglue/cpu_profiler.h\
perfglue/heap_profiler.h\
+ rgw/logrotate.conf\
rgw/rgw_acl.h\
rgw/rgw_acl_s3.h\
rgw/rgw_acl_swift.h\
diff --git a/src/logrotate.conf b/src/logrotate.conf
index 9af310413d9..62101b3a692 100644
--- a/src/logrotate.conf
+++ b/src/logrotate.conf
@@ -13,13 +13,11 @@
if which initctl > /dev/null && [ -x `which initctl` ]; then
# upstart reload isn't very helpful here:
# https://bugs.launchpad.net/upstart/+bug/1012938
- for type in mon osd mds; do
- initctl list \
- | perl -ne 'print "$+{service} cluster=$+{cluster} id=$+{id}\n" if m{^(?<service>ceph-(mon|osd|mds)+)\s+\((?<cluster>[^/)]+)/(?<id>[^)]+)\) start/}' \
- | while read l; do
- initctl reload -- $l 2>/dev/null || :
- done
- done
+ initctl list \
+ | sed -n 's/^\(ceph-\(mon\|osd\|mds\)\+\)[ \t]\+(\([^ \/]\+\)\/\([^ \/]\+\))[ \t]\+start\/.*$/\1 cluster=\3 id=\4/p' \
+ | while read l; do
+ initctl reload -- $l 2>/dev/null || :
+ done
fi
endscript
missingok
diff --git a/src/rgw/logrotate.conf b/src/rgw/logrotate.conf
new file mode 100644
index 00000000000..ae45e393546
--- /dev/null
+++ b/src/rgw/logrotate.conf
@@ -0,0 +1,24 @@
+/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
+ # Possibly reload twice, but depending on ceph.conf the reload above may be a no-op
+ if which initctl > /dev/null && [ -x `which initctl` ]; then
+ # upstart reload isn't very helpful here:
+ # https://bugs.launchpad.net/upstart/+bug/1012938
+ initctl list \
+ | sed -n 's/^\(radosgw\+\)[ \t]\+(\([^ \/]\+\)\/\([^ \/]\+\))[ \t]\+start\/.*$/\1 cluster=\2 id=\3/p' \
+ | while read l; do
+ initctl reload -- $l 2>/dev/null || :
+ done
+ 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);