Package: cupsys
Version: 1.2.7-4etch2
Severity: wishlist

Launchpad bug #LP41313 includes a patch to change the hard-coded default
error policy from 'stop-printer' to 'retry-job' but Till Kamppeter, the
author of the patch, says:

    A better solution would be adding a directive "DefaultErrorPolicy"
    to cupsd.conf, so distros can set this to "Retry job" in their
    desktop versions and "Stop printer" in their enterprise server
    versions.

The included patch does this, keeping the behaviour the same (ie. the
default in cupsd.conf and the default default if this is not set is
still 'stop-printer').

I would copy send this to Launchpad too, but it seems I have as much of
a phobia against web forums as Launchpad does against email.

#! /bin/sh /usr/share/dpatch/dpatch-run
## 99_default_error_policy.dpatch by  <[EMAIL PROTECTED]>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: No description.

@DPATCH@
diff -urNad cupsys-1.2.7-orig/conf/cupsd.conf.in cupsys-1.2.7/conf/cupsd.conf.in
--- cupsys-1.2.7-orig/conf/cupsd.conf.in	2008-01-10 14:08:08.000000000 +0000
+++ cupsys-1.2.7/conf/cupsd.conf.in	2008-01-10 13:49:19.000000000 +0000
@@ -47,6 +47,7 @@
 </Location>
 
 # Set the default printer/job policies...
+DefaultErrorPolicy stop-printer
 <Policy default>
   # Job-related operations must be done by the owner or an adminstrator...
   <Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set-Job-Attributes Create-Job-Subscription Renew-Subscription Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job Suspend-Current-Job Resume-Job CUPS-Move-Job>
diff -urNad cupsys-1.2.7-orig/scheduler/conf.c cupsys-1.2.7/scheduler/conf.c
--- cupsys-1.2.7-orig/scheduler/conf.c	2008-01-10 14:08:08.000000000 +0000
+++ cupsys-1.2.7/scheduler/conf.c	2008-01-10 13:49:19.000000000 +0000
@@ -107,6 +107,7 @@
   { "ConfigFilePerm",		&ConfigFilePerm,	CUPSD_VARTYPE_INTEGER },
   { "DataDir",			&DataDir,		CUPSD_VARTYPE_STRING },
   { "DefaultCharset",		&DefaultCharset,	CUPSD_VARTYPE_STRING },
+  { "DefaultErrorPolicy",	&DefaultErrorPolicy,	CUPSD_VARTYPE_STRING },
   { "DefaultLanguage",		&DefaultLanguage,	CUPSD_VARTYPE_STRING },
   { "DefaultLeaseDuration",	&DefaultLeaseDuration,	CUPSD_VARTYPE_INTEGER },
   { "DefaultPolicy",		&DefaultPolicy,		CUPSD_VARTYPE_STRING },
@@ -288,7 +289,8 @@
   cupsdSetString(&RemoteRoot, "remroot");
   cupsdSetString(&ServerHeader, "CUPS/1.2");
   cupsdSetString(&StateDir, CUPS_STATEDIR);
   cupsdSetString(&PidFile, "/var/run/cups/cupsd.pid");
+  cupsdSetString(&DefaultErrorPolicy, "stop-printer");
 
   if (!strcmp(CUPS_DEFAULT_PRINTCAP, "/etc/printers.conf"))
     PrintcapFormat = PRINTCAP_SOLARIS;
diff -urNad cupsys-1.2.7-orig/scheduler/conf.c.rej cupsys-1.2.7/scheduler/conf.c.rej
diff -urNad cupsys-1.2.7-orig/scheduler/printers.c cupsys-1.2.7/scheduler/printers.c
--- cupsys-1.2.7-orig/scheduler/printers.c	2008-01-10 14:08:08.000000000 +0000
+++ cupsys-1.2.7/scheduler/printers.c	2008-01-10 13:44:44.000000000 +0000
@@ -123,7 +123,7 @@
   cupsdSetString(&p->job_sheets[0], "none");
   cupsdSetString(&p->job_sheets[1], "none");
 
-  cupsdSetString(&p->error_policy, "stop-printer");
+  cupsdSetString(&p->error_policy, DefaultErrorPolicy);
   cupsdSetString(&p->op_policy, DefaultPolicy);
 
   p->op_policy_ptr = DefaultPolicyPtr;
diff -urNad cupsys-1.2.7-orig/scheduler/printers.h cupsys-1.2.7/scheduler/printers.h
--- cupsys-1.2.7-orig/scheduler/printers.h	2008-01-10 14:08:08.000000000 +0000
+++ cupsys-1.2.7/scheduler/printers.h	2008-01-10 13:40:47.000000000 +0000
@@ -104,7 +104,9 @@
 					/* Implicit class printers */
 VAR cupsd_printer_t	*DefaultPrinter	VALUE(NULL);
 					/* Default printer */
-VAR char		*DefaultPolicy	VALUE(NULL);
+VAR char		*DefaultErrorPolicy	VALUE(NULL),
+					/* Default error policy */
+			*DefaultPolicy	VALUE(NULL);
 					/* Default policy name */
 VAR cupsd_policy_t	*DefaultPolicyPtr
 					VALUE(NULL);
Matthew

-- 
I must take issue with the term "a mere child", for it has been my
invariable experience that the company of a mere child is infinitely
preferable to that of a mere adult.
                                           --  Fran Lebowitz

Reply via email to