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>
This commit is contained in:
Yehuda Sadeh 2013-01-17 13:06:14 -08:00 committed by Gary Lowell
parent e2e1de2720
commit c8eace6ff0
4 changed files with 19 additions and 1 deletions

View 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*

3
debian/rules vendored
View File

@ -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

14
src/rgw/logrotate.conf Normal file
View File

@ -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
}

View 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);