Resolves:#603040 - do not remove log if there is an error in rotate process

This commit is contained in:
Jan Kaluža 2010-06-15 14:06:54 +00:00
parent 9fabecb9f0
commit 3460fbd660
2 changed files with 23 additions and 1 deletions

View File

@ -0,0 +1,16 @@
Index: logrotate.c
===================================================================
--- logrotate.c (revision 276)
+++ logrotate.c (working copy)
@@ -848,9 +848,10 @@
mailLogWrapper(mailFilename,
mailCommand, logNum,
log);
- if (!hasErrors)
+ if (!hasErrors) {
message(MESS_DEBUG, "removing %s\n", mailFilename);
hasErrors = removeLogFile(mailFilename, log);
+ }
}
mail_out = i;
}

View File

@ -1,7 +1,7 @@
Summary: Rotates, compresses, removes and mails system log files Summary: Rotates, compresses, removes and mails system log files
Name: logrotate Name: logrotate
Version: 3.7.8 Version: 3.7.8
Release: 10%{?dist} Release: 11%{?dist}
License: GPL+ License: GPL+
Group: System Environment/Base Group: System Environment/Base
Source: https://fedorahosted.org/releases/l/o/logrotate/logrotate-%{version}.tar.gz Source: https://fedorahosted.org/releases/l/o/logrotate/logrotate-%{version}.tar.gz
@ -13,6 +13,7 @@ Patch5: logrotate-3.7.8-readonly.patch
#Patch6: logrotate-3.7.8-perm.patch #Patch6: logrotate-3.7.8-perm.patch
Patch7: logrotate-3.7.8-missingok.patch Patch7: logrotate-3.7.8-missingok.patch
Patch8: logrotate-3.7.8-configsize.patch Patch8: logrotate-3.7.8-configsize.patch
Patch9: logrotate-3.7.8-dont-remove-log.patch
Requires: coreutils >= 5.92 libsepol libselinux popt Requires: coreutils >= 5.92 libsepol libselinux popt
BuildRequires: libselinux-devel popt-devel BuildRequires: libselinux-devel popt-devel
@ -39,6 +40,7 @@ log files on your system.
#%%patch6 -p1 -b .perm #%%patch6 -p1 -b .perm
%patch7 -p1 -b .missingok %patch7 -p1 -b .missingok
%patch8 -p2 -b .configsize %patch8 -p2 -b .configsize
%patch9 -b dont-remove-log.patch
%build %build
make %{?_smp_mflags} RPM_OPT_FLAGS="$RPM_OPT_FLAGS" WITH_SELINUX=yes make %{?_smp_mflags} RPM_OPT_FLAGS="$RPM_OPT_FLAGS" WITH_SELINUX=yes
@ -69,6 +71,10 @@ rm -rf $RPM_BUILD_ROOT
%attr(0644, root, root) %verify(not size md5 mtime) %config(noreplace) %{_localstatedir}/lib/logrotate.status %attr(0644, root, root) %verify(not size md5 mtime) %config(noreplace) %{_localstatedir}/lib/logrotate.status
%changelog %changelog
* Tue Jun 15 2010 Jan Kaluza <jkaluza@redhat.com> 3.7.8-11
- fix #603040 - do not remove log if there is an error in
rotate process
* Tue Apr 20 2010 Jan Kaluza <jkaluza@redhat.com> 3.7.8-10 * Tue Apr 20 2010 Jan Kaluza <jkaluza@redhat.com> 3.7.8-10
- fix #602643 - logrotate "size" directive cannot exceed - fix #602643 - logrotate "size" directive cannot exceed
1895825408 bytes 1895825408 bytes