From 7cb9904f3bd15b82c2aed04b8218197f822ed579 Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Mon, 17 Feb 2014 17:15:17 +0000 Subject: [PATCH] Document 'journal' logging target. --- cups-journal.patch | 215 ++++++++++++++++++++++++++++++++------------- cups.spec | 5 +- 2 files changed, 157 insertions(+), 63 deletions(-) diff --git a/cups-journal.patch b/cups-journal.patch index aa6bb41..84358bd 100644 --- a/cups-journal.patch +++ b/cups-journal.patch @@ -1,17 +1,23 @@ -diff -up cups-1.7.0/Makedefs.in.journal cups-1.7.0/Makedefs.in ---- cups-1.7.0/Makedefs.in.journal 2013-10-24 16:35:59.103969053 +0100 -+++ cups-1.7.0/Makedefs.in 2013-10-24 16:35:59.175969379 +0100 -@@ -143,6 +143,7 @@ IPPFIND_BIN = @IPPFIND_BIN@ - IPPFIND_MAN = @IPPFIND_MAN@ - LAUNCHDLIBS = @LAUNCHDLIBS@ - SDLIBS = @SDLIBS@ -+SDJLIBS = @SDJLIBS@ - LDFLAGS = -L../cgi-bin -L../cups -L../filter -L../ppdc \ - -L../scheduler @LDARCHFLAGS@ \ - @LDFLAGS@ @RELROFLAGS@ @PIEFLAGS@ $(OPTIM) -diff -up cups-1.7.0/config-scripts/cups-systemd.m4.journal cups-1.7.0/config-scripts/cups-systemd.m4 ---- cups-1.7.0/config-scripts/cups-systemd.m4.journal 2013-10-24 16:35:59.101969044 +0100 -+++ cups-1.7.0/config-scripts/cups-systemd.m4 2013-10-24 16:35:59.175969379 +0100 +diff -up cups-1.7.1/config.h.in.journal cups-1.7.1/config.h.in +--- cups-1.7.1/config.h.in.journal 2014-02-17 16:48:19.089795987 +0000 ++++ cups-1.7.1/config.h.in 2014-02-17 16:48:19.136796218 +0000 +@@ -458,6 +458,13 @@ + + + /* ++ * Do we have systemd-journal support? ++ */ ++ ++#undef HAVE_JOURNAL ++ ++ ++/* + * Various scripting languages... + */ + +diff -up cups-1.7.1/config-scripts/cups-systemd.m4.journal cups-1.7.1/config-scripts/cups-systemd.m4 +--- cups-1.7.1/config-scripts/cups-systemd.m4.journal 2014-02-17 16:48:19.089795987 +0000 ++++ cups-1.7.1/config-scripts/cups-systemd.m4 2014-02-17 16:48:19.136796218 +0000 @@ -22,6 +22,15 @@ if test "x$with_systemdsystemunitdir" != fi fi @@ -36,48 +42,112 @@ diff -up cups-1.7.0/config-scripts/cups-systemd.m4.journal cups-1.7.0/config-scr dnl dnl "$Id$" -diff -up cups-1.7.0/config.h.in.journal cups-1.7.0/config.h.in ---- cups-1.7.0/config.h.in.journal 2013-10-24 16:35:59.101969044 +0100 -+++ cups-1.7.0/config.h.in 2013-10-24 16:35:59.176969383 +0100 -@@ -458,6 +458,13 @@ +diff -up cups-1.7.1/doc/help/ref-cups-files-conf.html.in.journal cups-1.7.1/doc/help/ref-cups-files-conf.html.in +--- cups-1.7.1/doc/help/ref-cups-files-conf.html.in.journal 2014-02-17 17:06:11.652078495 +0000 ++++ cups-1.7.1/doc/help/ref-cups-files-conf.html.in 2014-02-17 17:11:50.675752398 +0000 +@@ -18,6 +18,7 @@ + AccessLog /var/log/cups/access_log + AccessLog /var/log/cups/access_log-%s + AccessLog syslog ++AccessLog journal + +

Description

+@@ -36,6 +37,9 @@ server activity.

+

The special name "syslog" can be used to send the access + information to the system log instead of a plain file.

- /* -+ * Do we have systemd-journal support? -+ */ ++

The special name "journal" can be used to send the access ++information to the system log instead of a plain file.

+ -+#undef HAVE_JOURNAL +

The default access log file is + /var/log/access_log.

+ +@@ -108,6 +112,7 @@ language needed.

+ ErrorLog /var/log/cups/error_log + ErrorLog /var/log/cups/error_log-%s + ErrorLog syslog ++ErrorLog journal + + +

Description

+@@ -124,6 +129,11 @@ default error log file is /var/log/ +

The special name "syslog" can be used to send the error + information to the system log instead of a plain file.

+ ++

The special name "journal" can be used to send the error ++information to the system journal instead of a plain file. Information ++relating to a specific job is logged with the field ++CUPS_JOB_ID filled in.

+ + +

CUPS 1.4/OS X 10.6FatalErrors

+ +@@ -266,6 +276,7 @@ is 644.

+ PageLog /var/log/cups/page_log + PageLog /var/log/cups/page_log-%s + PageLog syslog ++PageLog journal + + +

Description

+@@ -282,6 +293,11 @@ default page log file is /var/log/c +

The special name "syslog" can be used to send the page + information to the system log instead of a plain file.

+ ++

The special name "journal" can be used to send the page information ++to the system journal instead of a plain file. The fields ++CUPS_JOB_ID and CUPS_PAGE_NUMBER will be ++filled in.

+ -+/* - * Various scripting languages... - */ -diff -up cups-1.7.0/scheduler/Makefile.journal cups-1.7.0/scheduler/Makefile ---- cups-1.7.0/scheduler/Makefile.journal 2013-10-24 16:35:59.133969189 +0100 -+++ cups-1.7.0/scheduler/Makefile 2013-10-24 16:35:59.176969383 +0100 -@@ -383,7 +383,7 @@ cupsd: $(CUPSDOBJS) $(LIBCUPSMIME) ../cu - $(CC) $(LDFLAGS) -o cupsd $(CUPSDOBJS) -L. -lcupsmime \ - $(LIBZ) $(SSLLIBS) $(LIBSLP) $(LIBLDAP) $(PAMLIBS) \ - $(LIBPAPER) $(LIBMALLOC) $(SERVERLIBS) $(DNSSDLIBS) $(LIBS) \ -- $(LIBGSSAPI) $(LIBWRAP) $(SDLIBS) -+ $(LIBGSSAPI) $(LIBWRAP) $(SDLIBS) $(SDJLIBS) +

Printcap

- cupsd-static: $(CUPSDOBJS) libcupsmime.a ../cups/$(LIBCUPSSTATIC) - echo Linking $@... -@@ -391,7 +391,7 @@ cupsd-static: $(CUPSDOBJS) libcupsmime.a - $(LIBZ) $(SSLLIBS) $(LIBSLP) $(LIBLDAP) $(PAMLIBS) \ - ../cups/$(LIBCUPSSTATIC) $(COMMONLIBS) $(LIBZ) $(LIBPAPER) \ - $(LIBMALLOC) $(SERVERLIBS) $(DNSSDLIBS) $(LIBGSSAPI) \ -- $(LIBWRAP) $(SDLIBS) -+ $(LIBWRAP) $(SDLIBS) $(SDJLIBS) - - tls.o: tls-darwin.c tls-gnutls.c tls-openssl.c - -diff -up cups-1.7.0/scheduler/conf.c.journal cups-1.7.0/scheduler/conf.c ---- cups-1.7.0/scheduler/conf.c.journal 2013-10-24 16:35:59.058968850 +0100 -+++ cups-1.7.0/scheduler/conf.c 2013-10-24 16:35:59.176969383 +0100 -@@ -973,9 +973,9 @@ cupsdReadConfiguration(void) +diff -up cups-1.7.1/Makedefs.in.journal cups-1.7.1/Makedefs.in +--- cups-1.7.1/Makedefs.in.journal 2014-02-17 16:48:19.090795992 +0000 ++++ cups-1.7.1/Makedefs.in 2014-02-17 16:48:19.136796218 +0000 +@@ -143,6 +143,7 @@ IPPFIND_BIN = @IPPFIND_BIN@ + IPPFIND_MAN = @IPPFIND_MAN@ + LAUNCHDLIBS = @LAUNCHDLIBS@ + SDLIBS = @SDLIBS@ ++SDJLIBS = @SDJLIBS@ + LDFLAGS = -L../cgi-bin -L../cups -L../filter -L../ppdc \ + -L../scheduler @LDARCHFLAGS@ \ + @LDFLAGS@ @RELROFLAGS@ @PIEFLAGS@ $(OPTIM) +diff -up cups-1.7.1/man/cups-files.conf.man.in.journal cups-1.7.1/man/cups-files.conf.man.in +--- cups-1.7.1/man/cups-files.conf.man.in.journal 2014-02-17 17:05:08.103764935 +0000 ++++ cups-1.7.1/man/cups-files.conf.man.in 2014-02-17 17:06:48.131258521 +0000 +@@ -29,6 +29,8 @@ on-line help for detailed descriptions: + AccessLog filename + .TP 5 + AccessLog syslog ++.TP 5 ++AccessLog journal + .br + Defines the access log filename. + .TP 5 +@@ -48,6 +50,8 @@ Specifies the root directory for the int + ErrorLog filename + .TP 5 + ErrorLog syslog ++.TP 5 ++ErrorLog journal + .br + Specifies the error log filename. + .TP 5 +@@ -83,6 +87,8 @@ Specifies the permissions for all log fi + PageLog filename + .TP 5 + PageLog syslog ++.TP 5 ++PageLog journal + .br + Specifies the page log filename. + .TP 5 +diff -up cups-1.7.1/scheduler/conf.c.journal cups-1.7.1/scheduler/conf.c +--- cups-1.7.1/scheduler/conf.c.journal 2014-02-17 16:48:19.047795781 +0000 ++++ cups-1.7.1/scheduler/conf.c 2014-02-17 16:48:19.137796223 +0000 +@@ -950,9 +950,9 @@ cupsdReadConfiguration(void) */ #ifdef HAVE_VSYSLOG @@ -90,7 +160,7 @@ diff -up cups-1.7.0/scheduler/conf.c.journal cups-1.7.0/scheduler/conf.c openlog("cupsd", LOG_PID | LOG_NOWAIT | LOG_NDELAY, LOG_LPR); #endif /* HAVE_VSYSLOG */ -@@ -983,13 +983,13 @@ cupsdReadConfiguration(void) +@@ -960,13 +960,13 @@ cupsdReadConfiguration(void) * Make sure each of the log files exists and gets rotated as necessary... */ @@ -107,9 +177,9 @@ diff -up cups-1.7.0/scheduler/conf.c.journal cups-1.7.0/scheduler/conf.c cupsdCheckLogFile(&PageFile, PageLog); /* -diff -up cups-1.7.0/scheduler/conf.h.journal cups-1.7.0/scheduler/conf.h ---- cups-1.7.0/scheduler/conf.h.journal 2013-10-24 16:35:59.058968850 +0100 -+++ cups-1.7.0/scheduler/conf.h 2013-10-24 16:35:59.177969388 +0100 +diff -up cups-1.7.1/scheduler/conf.h.journal cups-1.7.1/scheduler/conf.h +--- cups-1.7.1/scheduler/conf.h.journal 2014-02-17 16:48:19.048795786 +0000 ++++ cups-1.7.1/scheduler/conf.h 2014-02-17 16:48:19.138796228 +0000 @@ -297,6 +297,8 @@ extern int cupsdLogMessage(int level, co extern int cupsdLogPage(cupsd_job_t *job, const char *page); extern int cupsdLogRequest(cupsd_client_t *con, http_status_t code); @@ -119,9 +189,9 @@ diff -up cups-1.7.0/scheduler/conf.h.journal cups-1.7.0/scheduler/conf.h extern int cupsdWriteErrorLog(int level, const char *message); -diff -up cups-1.7.0/scheduler/log.c.journal cups-1.7.0/scheduler/log.c ---- cups-1.7.0/scheduler/log.c.journal 2013-10-24 16:35:59.083968963 +0100 -+++ cups-1.7.0/scheduler/log.c 2013-10-24 16:38:02.352526508 +0100 +diff -up cups-1.7.1/scheduler/log.c.journal cups-1.7.1/scheduler/log.c +--- cups-1.7.1/scheduler/log.c.journal 2014-02-17 16:48:19.073795909 +0000 ++++ cups-1.7.1/scheduler/log.c 2014-02-17 16:48:19.138796228 +0000 @@ -21,6 +21,7 @@ * cupsdLogMessage() - Log a message to the error log file. * cupsdLogPage() - Log a page to the page log file. @@ -140,7 +210,7 @@ diff -up cups-1.7.0/scheduler/log.c.journal cups-1.7.0/scheduler/log.c /* -@@ -558,8 +562,17 @@ cupsdLogJob(cupsd_job_t *job, /* I - Jo +@@ -559,8 +563,17 @@ cupsdLogJob(cupsd_job_t *job, /* I - Jo } else if (level <= LogLevel && (level != CUPSD_LOG_INFO || LogLevel >= CUPSD_LOG_DEBUG)) @@ -160,7 +230,7 @@ diff -up cups-1.7.0/scheduler/log.c.journal cups-1.7.0/scheduler/log.c return (1); } else -@@ -788,6 +801,15 @@ cupsdLogPage(cupsd_job_t *job, /* I - J +@@ -789,6 +802,15 @@ cupsdLogPage(cupsd_job_t *job, /* I - J *bufptr = '\0'; @@ -176,7 +246,7 @@ diff -up cups-1.7.0/scheduler/log.c.journal cups-1.7.0/scheduler/log.c #ifdef HAVE_VSYSLOG /* * See if we are logging pages via syslog... -@@ -963,7 +985,7 @@ cupsdLogRequest(cupsd_client_t *con, /* +@@ -964,7 +986,7 @@ cupsdLogRequest(cupsd_client_t *con, /* * See if we are logging accesses via syslog... */ @@ -185,7 +255,7 @@ diff -up cups-1.7.0/scheduler/log.c.journal cups-1.7.0/scheduler/log.c { syslog(LOG_INFO, "REQUEST %s - %s \"%s %s HTTP/%d.%d\" %d " CUPS_LLFMT " %s %s\n", -@@ -1017,8 +1039,9 @@ cupsdLogRequest(cupsd_client_t *con, /* +@@ -1018,8 +1040,9 @@ cupsdLogRequest(cupsd_client_t *con, /* */ int /* O - 1 on success, 0 on failure */ @@ -197,7 +267,7 @@ diff -up cups-1.7.0/scheduler/log.c.journal cups-1.7.0/scheduler/log.c { static const char levels[] = /* Log levels... */ { -@@ -1035,12 +1058,25 @@ cupsdWriteErrorLog(int level, /* +@@ -1036,12 +1059,25 @@ cupsdWriteErrorLog(int level, /* }; @@ -224,7 +294,7 @@ diff -up cups-1.7.0/scheduler/log.c.journal cups-1.7.0/scheduler/log.c { syslog(syslevels[level], "%s", message); return (1); -@@ -1066,6 +1102,18 @@ cupsdWriteErrorLog(int level, /* +@@ -1067,6 +1103,18 @@ cupsdWriteErrorLog(int level, /* } @@ -243,3 +313,24 @@ diff -up cups-1.7.0/scheduler/log.c.journal cups-1.7.0/scheduler/log.c /* * 'format_log_line()' - Format a line for a log file. * +diff -up cups-1.7.1/scheduler/Makefile.journal cups-1.7.1/scheduler/Makefile +--- cups-1.7.1/scheduler/Makefile.journal 2014-02-17 16:48:19.124796159 +0000 ++++ cups-1.7.1/scheduler/Makefile 2014-02-17 16:48:19.137796223 +0000 +@@ -383,7 +383,7 @@ cupsd: $(CUPSDOBJS) $(LIBCUPSMIME) ../cu + $(CC) $(LDFLAGS) -o cupsd $(CUPSDOBJS) -L. -lcupsmime \ + $(LIBZ) $(SSLLIBS) $(LIBSLP) $(LIBLDAP) $(PAMLIBS) \ + $(LIBPAPER) $(LIBMALLOC) $(SERVERLIBS) $(DNSSDLIBS) $(LIBS) \ +- $(LIBGSSAPI) $(LIBWRAP) $(SDLIBS) ++ $(LIBGSSAPI) $(LIBWRAP) $(SDLIBS) $(SDJLIBS) + + cupsd-static: $(CUPSDOBJS) libcupsmime.a ../cups/$(LIBCUPSSTATIC) + echo Linking $@... +@@ -391,7 +391,7 @@ cupsd-static: $(CUPSDOBJS) libcupsmime.a + $(LIBZ) $(SSLLIBS) $(LIBSLP) $(LIBLDAP) $(PAMLIBS) \ + ../cups/$(LIBCUPSSTATIC) $(COMMONLIBS) $(LIBZ) $(LIBPAPER) \ + $(LIBMALLOC) $(SERVERLIBS) $(DNSSDLIBS) $(LIBGSSAPI) \ +- $(LIBWRAP) $(SDLIBS) ++ $(LIBWRAP) $(SDLIBS) $(SDJLIBS) + + tls.o: tls-darwin.c tls-gnutls.c tls-openssl.c + diff --git a/cups.spec b/cups.spec index f3356c2..9a147ed 100644 --- a/cups.spec +++ b/cups.spec @@ -11,7 +11,7 @@ Summary: CUPS printing system Name: cups Epoch: 1 Version: 1.7.1 -Release: 3%{?dist} +Release: 4%{?dist} License: GPLv2 Group: System Environment/Daemons Url: http://www.cups.org/ @@ -643,6 +643,9 @@ rm -f %{cups_serverbin}/backend/smb %{_mandir}/man5/ipptoolfile.5.gz %changelog +* Mon Feb 17 2014 Tim Waugh - 1:1.7.1-4 +- Document 'journal' logging target. + * Tue Feb 11 2014 Tim Waugh - 1:1.7.1-3 - Prevent dnssd backend exiting too early (bug #1026940, STR #4365).