rpms/cups/devel cups-logrotate.patch, NONE, 1.1 cups.spec, 1.388, 1.389
Tim Waugh (twaugh)
fedora-extras-commits at redhat.com
Thu Feb 14 12:50:16 UTC 2008
- Previous message (by thread): rpms/R-waveslim/devel R-waveslim.spec,1.11,1.12
- Next message (by thread): rpms/cproto/F-8 .cvsignore, 1.4, 1.5 cproto.spec, 1.9, 1.10 sources, 1.4, 1.5 cproto-segfault.patch, 1.1, NONE
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Author: twaugh
Update of /cvs/pkgs/rpms/cups/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv28010
Modified Files:
cups.spec
Added Files:
cups-logrotate.patch
Log Message:
* Thu Feb 14 2008 Tim Waugh <twaugh at redhat.com>
- Try out logrotate again (bug #432730).
cups-logrotate.patch:
--- NEW FILE cups-logrotate.patch ---
diff -up cups-1.3.5/scheduler/log.c.logrotate cups-1.3.5/scheduler/log.c
--- cups-1.3.5/scheduler/log.c.logrotate 2008-02-14 12:21:25.000000000 +0000
+++ cups-1.3.5/scheduler/log.c 2008-02-14 12:24:16.000000000 +0000
@@ -29,6 +29,9 @@
#include "cupsd.h"
#include <stdarg.h>
#include <syslog.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
/*
@@ -467,12 +470,10 @@ check_log_file(cups_file_t **lf, /* IO -
return (1);
/*
- * Format the filename as needed...
+ * Format the filename...
*/
- if (!*lf ||
- (strncmp(logname, "/dev/", 5) && cupsFileTell(*lf) > MaxLogSize &&
- MaxLogSize > 0))
+ if (strncmp(logname, "/dev/", 5))
{
/*
* Handle format strings...
@@ -565,6 +566,34 @@ check_log_file(cups_file_t **lf, /* IO -
}
/*
+ * Has someone else (i.e. logrotate) already rotated the log for us?
+ */
+ else if (strncmp(filename, "/dev/", 5))
+ {
+ struct stat st;
+ if (stat(filename, &st) || st.st_size == 0)
+ {
+ /* File is either missing or has zero size. */
+
+ cupsFileClose(*lf);
+ if ((*lf = cupsFileOpen(filename, "a")) == NULL)
+ {
+ syslog(LOG_ERR, "Unable to open log file \"%s\" - %s", filename,
+ strerror(errno));
+
+ return (0);
+ }
+
+ /*
+ * Change ownership and permissions of non-device logs...
+ */
+
+ fchown(cupsFileNumber(*lf), RunUser, Group);
+ fchmod(cupsFileNumber(*lf), LogFilePerm);
+ }
+ }
+
+ /*
* Do we need to rotate the log?
*/
Index: cups.spec
===================================================================
RCS file: /cvs/pkgs/rpms/cups/devel/cups.spec,v
retrieving revision 1.388
retrieving revision 1.389
diff -u -r1.388 -r1.389
--- cups.spec 12 Feb 2008 16:41:02 -0000 1.388
+++ cups.spec 14 Feb 2008 12:49:40 -0000 1.389
@@ -18,6 +18,7 @@
Source6: pstoraster
Source7: pstoraster.convs
Source8: postscript.ppd.gz
+Source9: cups.logrotate
Source10: ncp.backend
Source11: cups.conf
Source12: cups.cron
@@ -47,6 +48,7 @@
Patch20: cups-getpass.patch
Patch21: cups-driverd-timeout.patch
Patch22: cups-strict-ppd-line-length.patch
+Patch23: cups-logrotate.patch
Patch25: cups-usb-paperout.patch
Patch100: cups-lspp.patch
Epoch: 1
@@ -162,6 +164,7 @@
%patch20 -p1 -b .getpass
%patch21 -p1 -b .driverd-timeout
%patch22 -p1 -b .strict-ppd-line-length
+%patch23 -p1 -b .logrotate
%patch25 -p1 -b .usb-paperout
%if %lspp
@@ -222,9 +225,10 @@
popd
%endif
-mkdir -p $RPM_BUILD_ROOT%{_datadir}/pixmaps $RPM_BUILD_ROOT%{_sysconfdir}/X11/sysconfig $RPM_BUILD_ROOT%{_sysconfdir}/X11/applnk/System $RPM_BUILD_ROOT%{_sysconfdir}/xinetd.d $RPM_BUILD_ROOT%{_sysconfdir}/cron.daily
+mkdir -p $RPM_BUILD_ROOT%{_datadir}/pixmaps $RPM_BUILD_ROOT%{_sysconfdir}/X11/sysconfig $RPM_BUILD_ROOT%{_sysconfdir}/X11/applnk/System $RPM_BUILD_ROOT%{_sysconfdir}/xinetd.d $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d $RPM_BUILD_ROOT%{_sysconfdir}/cron.daily
install -c -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_datadir}/pixmaps
install -c -m 644 cups-lpd.real $RPM_BUILD_ROOT%{_sysconfdir}/xinetd.d/cups-lpd
+install -c -m 644 %{SOURCE9} $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/cups
install -c -m 755 %{SOURCE10} $RPM_BUILD_ROOT%{cups_serverbin}/backend/ncp
install -c -m 755 %{SOURCE12} $RPM_BUILD_ROOT%{_sysconfdir}/cron.daily/cups
install -c -m 644 %{SOURCE13} $RPM_BUILD_ROOT%{_sysconfdir}/cups/pdftops.conf
@@ -377,6 +381,7 @@
%dir %attr(0700,root,lp) /etc/cups/ssl
/etc/cups/pstoraster.convs
%config(noreplace) /etc/pam.d/cups
+%config(noreplace) %{_sysconfdir}/logrotate.d/cups
%dir %{_docdir}/cups-%{version}
%{_docdir}/cups-%{version}/favicon.*
%{_docdir}/cups-%{version}/images
@@ -454,6 +459,9 @@
%{cups_serverbin}/daemon/cups-lpd
%changelog
+* Thu Feb 14 2008 Tim Waugh <twaugh at redhat.com>
+- Try out logrotate again (bug #432730).
+
* Tue Feb 12 2008 Tim Waugh <twaugh at redhat.com> 1:1.3.5-5
- Fixed admin.cgi handling of DefaultAuthType (bug #432478, STR #2703).
- Previous message (by thread): rpms/R-waveslim/devel R-waveslim.spec,1.11,1.12
- Next message (by thread): rpms/cproto/F-8 .cvsignore, 1.4, 1.5 cproto.spec, 1.9, 1.10 sources, 1.4, 1.5 cproto-segfault.patch, 1.1, NONE
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the fedora-extras-commits
mailing list