James Matheson
2002-Sep-03 16:58 UTC
[Samba] Spool files not deleted when "printing = cups"
We're using the built-in CUPS interface for printing from Samba and this,
as shipped, leaves the spool files in the directory defined by
[printers]
path = whatever
in smb.conf. Other printing types typically explicitely delete these
files as part of the print command but the CUPS interface doesn't
offer any facility to do this. A possible solution is, as in the
attached patch, to delete the file at the end of cups_job_submit().
print_cups.c.dist is as distributed in samba-2.2.5.tar.gz .
A cleaner (more generic) alternative might be to add a configuration option
applicable to all printing types which does the deletion, eg
remove printfile = yes
--
James M.R.Matheson
Head of Computer Systems Group, E-mail: jmrm@eng.cam.ac.uk
University Engineering Dept, Phone: +44-1223-332756/332711
Trumpington Street, Fax: +44-1223-332662
Cambridge CB2 1PZ, WWW: http://www.eng.cam.ac.uk/~jmrm/
England.
-----------------------------------------------------------------
*** source/printing/print_cups.c.dist Fri May 3 02:03:31 2002
--- source/printing/print_cups.c Tue Sep 3 11:59:56 2002
***************
*** 662,669 ****
--- 662,671 ----
DEBUG(0,("Unable to print file to `%s' - %s\n",
PRINTERNAME(snum),
ippErrorString(cupsLastError())));
httpClose(http);
+ if (unlink (pjob->filename) != 0)
+ DEBUG(0,("Unable to unlink CUPS spool file %s\n",
pjob->filename));
return (ret);
}
James Matheson wrote on "samba digest":> Message: 4 > Date: Tue, 3 Sep 2002 17:57:39 +0100 (BST) > From: James Matheson <jmrm@eng.cam.ac.uk> > To: <samba@samba.org> > Organization: University Engineering Department. Cambridge. England > Subject: [Samba] Spool files not deleted when "printing = cups" > > We're using the built-in CUPS interface for printing from Samba and this, > as shipped, leaves the spool files in the directory defined by > [printers] > path = whatever > in smb.conf. Other printing types typically explicitely delete these > files as part of the print command but the CUPS interface doesn't > offer any facility to do this. A possible solution is, as in the > attached patch, to delete the file at the end of cups_job_submit(). > print_cups.c.dist is as distributed in samba-2.2.5.tar.gz . > > A cleaner (more generic) alternative might be to add a configuration option > applicable to all printing types which does the deletion, eg > remove printfile = yes > > -- > James M.R.MathesonHi, James, have you tried to set "PreserveJobFiles No" and "PreserveJobHistory No" in /etc/cups/cupsd.conf? Does it produce the same results? Cheers, Kurt