From mkb@altair.mukappabeta.net  Sat Mar 30 14:45:02 2002
Return-Path: <mkb@altair.mukappabeta.net>
Received: from altair.mukappabeta.net (altair.mukappabeta.net [194.145.150.157])
	by hub.freebsd.org (Postfix) with ESMTP id 0551F37B419
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 30 Mar 2002 14:45:01 -0800 (PST)
Received: by altair.mukappabeta.net (Postfix, from userid 1001)
	id 84E5E460; Sat, 30 Mar 2002 23:44:51 +0100 (CET)
Message-Id: <20020330224451.84E5E460@altair.mukappabeta.net>
Date: Sat, 30 Mar 2002 23:44:51 +0100 (CET)
From: Matthias Buelow <mkb@altair.mukappabeta.net>
Reply-To: Matthias Buelow <mkb@altair.mukappabeta.net>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: lpd doesn't delete spool files
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         36552
>Category:       bin
>Synopsis:       lpd doesn't delete spool files
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    gad
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Mar 30 14:50:01 PST 2002
>Closed-Date:    Thu Apr 18 13:31:40 PDT 2002
>Last-Modified:  Thu Apr 18 13:31:40 PDT 2002
>Originator:     Matthias Buelow
>Release:        FreeBSD 4.5-20020326-STABLE i386
>Organization:
>Environment:
System: FreeBSD altair.mukappabeta.net 4.5-20020326-STABLE FreeBSD 4.5-20020326-STABLE #0: Sat Mar 30 03:08:40 CET 2002 root@:/usr2/src/sys/compile/ALTAIR i386

>Description:

	After successful printing a file on a remote printer, lpd
	doesn't remove the file in the spool dir, thus locking up
	the printing service and printing it again if the daemon
	is restarted.

>How-To-Repeat:

	I've got the following printcap:

	ps|remote laser postscript printer:\
		:sd=/var/spool/output/lpd:lf=/var/log/lpd-errs:\
		:of=/usr/local/sbin/psfilt:\
		:sh:rm=eps1:rp=wastebasket_p1:

	using a Lantronix EPS1 printer server.

	The /usr/local/sbin/psfilt script, used as output filter,
	contains the following line:

	gs -q -dSAFER -sDEVICE=ljet4 -sPAPERSIZE=a4 -sOutputFile=- -

	Printing a postscript file works but it leaves the spool
	file hanging around:

	# lpq -Pps
	altair.mukappabeta.net: sending to eps1
	Rank   Owner      Job  Files                                 Total Size
	1st    mkb        2    test.ps                               182732 bytes


	Posn Entry   Source Node        Service           Port      Status  Source
	   --        192.168.0.1        WASTEBASKET_P1    Port_2    Active  RLpr
	   2  17     192.168.0.1        WASTEBASKET_P1    N/A       Queued  RLpr


	# ls -la /var/spool/output/lpd
	total 192
	drwxrwxr-x  2 root    daemon     512 Mar 30 23:35 .
	drwxr-xr-x  3 root    daemon     512 Mar 30 23:27 ..
	-rw-r----x  1 root    daemon       4 Mar 30 23:34 .seq
	-rw-rw----  1 daemon  daemon     122 Mar 30 23:34 cfA002altair.mukappabeta.net
	-rw-rw----  1 mkb     daemon  182732 Mar 30 23:34 dfA002altair.mukappabeta.net
	-rw-rw-r--  1 root    daemon       0 Mar 30 23:34 errs.G9KhLPX
	-rw-rw-r--  1 root    daemon      35 Mar 30 23:35 lock
	-rw-rw-r--  1 root    daemon      16 Mar 30 23:34 status


>Fix:

	No clue, except replacing the blasted BSD lpd, which is always
	causing trouble, with something that works, like LPRng.


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->gad 
Responsible-Changed-By: dwmalone 
Responsible-Changed-When: Tue Apr 2 01:23:03 PST 2002 
Responsible-Changed-Why:  
Lpd is Garance's. 

Mind you, I've never had a problem with lpd not deleting spool files 
after remote printing (using remote BSD lpds, Linux lpds and the 
lpd in Lexmark printers), so it may either be a local configuration 
problem or some bad interaction with your Lantronix EPS1 printer 
server. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=36552 

From: Garance A Drosehn <gad@FreeBSD.org>
To: freebsd-gnats-submit@FreeBSD.org, mkb@altair.mukappabeta.net
Cc:  
Subject: Re: bin/36552: lpd doesn't delete spool files
Date: Tue, 2 Apr 2002 22:26:48 -0500

 Matthias Buelow writes:
 > After successful printing a file on a remote printer, lpd doesn't 
 > remove the file in the spool dir, ...
 
 Hmm.
 
 > I've got the following printcap:
 >
 > 	ps|remote laser postscript printer:\
 > 		:sd=/var/spool/output/lpd:lf=/var/log/lpd-errs:\
 > 		:of=/usr/local/sbin/psfilt:\
 > 		:sh:rm=eps1:rp=wastebasket_p1:
 
 I notice you're using an output filter on a remote-queue.  By remarkable 
 coincidence, I just happened to be rewriting that code last night.  From 
 my testing, it was apparent that there are a few subtle bugs in 
 output-filters for remote-queues.  Those bugs do not seem to cause any 
 problem if the remote host is another freebsd box, but I can believe 
 they might cause trouble when connecting to other implementations of lpd.
 
 For the simple fix, try changing the 'of=' to 'if='.  As far as your 
 script is concerned, the only difference is that it will be started up 
 with a few extra parameters.  If your script ignores those extra 
 parameters, it should work OK as an input filter.
 
 If you have the time to try some experimentation, we could try out the 
 change I wrote up last night and see if it helps.  That update is not 
 even installed in -current yet, but I could make the update available 
 for you to patch the lpr sources in stable.  If that patch does *not* 
 work, or if the simple fix does not work, let me know and we'll try to 
 write up a better fix for whatever problem you are running into.
 
 In the audit-trail, David Malone writes:
 > Mind you, I've never had a problem with lpd not deleting spool files 
 > after remote printing (using remote BSD lpds, Linux lpds and the lpd in 
 > Lexmark printers), ...
 
 I am pretty sure that Matthias is seeing a problem due to output 
 filters.  However, there is also some problem where *occasionally* lpd 
 will not remove the datafiles for a print job after the job is done.  We 
 print thousands of jobs a day here at RPI, and yet I will only see this 
 happen a few times a week.  The problem is different than what Matthias 
 sees in that the control-file *is* removed, and only the data file 
 sticks around.  I hope to track that bug down too.  Someday...
 
 ---
 Garance Alistair Drosehn     =      gad@gilead.acs.rpi.edu
 Senior Systems Programmer           or     gad@FreeBSD.org
 Rensselaer Polytechnic Institute;           Troy NY    USA
 
State-Changed-From-To: open->closed 
State-Changed-By: gad 
State-Changed-When: Thu Apr 18 13:29:17 PDT 2002 
State-Changed-Why:  
.   I've installed a change to lpd/printjob.c in both freebsd-current and 
freebsd-stable which should take care of odd behavior seen when using 
output filters (of=) on print queues to remote (rm=) printers. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=36552 
>Unformatted:
