Bug 36552 - lpd doesn't delete spool files
Summary: lpd doesn't delete spool files
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: Unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: Garance A Drosehn
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-03-30 22:50 UTC by Matthias Buelow
Modified: 2002-04-18 21:31 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Buelow 2002-03-30 22:50:01 UTC
	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.

Fix: 

No clue, except replacing the blasted BSD lpd, which is always
	causing trouble, with something that works, like LPRng.
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
Comment 1 dwmalone freebsd_committer freebsd_triage 2002-04-02 10:23:03 UTC
Responsible Changed
From-To: freebsd-bugs->gad

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.
Comment 2 Garance A Drosehn freebsd_committer freebsd_triage 2002-04-03 04:26:48 UTC
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
Comment 3 Garance A Drosehn freebsd_committer freebsd_triage 2002-04-18 21:29:17 UTC
State Changed
From-To: open->closed

.   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.