9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: geoff@collyer.net
To: 9fans@cse.psu.edu
Subject: Re: [9fans] lp
Date: Fri, 26 Oct 2001 17:10:27 -0700	[thread overview]
Message-ID: <0GLU00HWE8HO5F@mta5.snfc21.pbi.net> (raw)

lp has a long list of problems, the most serious of which is that it
isn't a real printer spooler: after trying to print your job twice, lp
tosses it and sends you mail saying "i tossed your print job".  So if
your printer jams, runs out of paper or gets turned off, and you don't
immediately notice and jump up and fix it, lp will happily throw away
all jobs for that printer.  A real printer spooler persists
indefinitely until it either succeeds at printing a job or gets a
permanent fatal error from the printer (e.g., "the postscript you gave
me was bogus"), on the assumption that it may have taken you
considerable effort to generate any given print job and you probably
didn't save a copy (with tee).

And ghod help you if you have more than one sysname or domain name for
a spooling host; lp is likely to loop sending jobs to that host
endlessly because it doesn't go to the trouble to check the current
host's $sysname or output of

	ndb/query sys $sysname dom

against its complete set of sysnames and domain names.

And why is it copying files from Plan 9 machine to Plan 9 machine?  It
could just as easily copy the job into the (shared) printer queue
locally.

But lp loves to copy files.  I haven't counted the number of copies of
a job that lp makes in the process of printing it (and it depends upon
the kind of input), but you'd be amazed at the amount of copying
(sometimes with trivial transformations).

There's an awful lot of unexploited generality in /sys/lib/lp/devices.
What does a spooler really need to know to drive a printer?  If it's
on a serial or parallel port, what machine drives it and on what port
with what (serial) line configuration.  If it's a network printer, how
to contact it (what dialstring to use).  What form(s) of input will
the printer accept (Postscript, PDF, PCL, text, rasters) and what, if
anything, must be emitted to switch a printer from one to another.  A
typical devices entry has 3 or 4 entries of "generic" and much of the
detail of how to drive the printer is jammed into an options or class
field.  The last field is virtually always "FIFO"; it's a little hard
to see why one would want to operate a printer "queue" as a stack or
heap.  The domain name and sysname of a network printer make perfectly
good names, there's no need for a special "printer destination" name
space.  So for the common case of a network Postscript 2 printer
accessible on service "printer" (port 515), all that's really needed
for a devices entry is

	ourprinter ourcpu ps2

and that looks like it could be a minor augmentation to ndb:

	ip=66.120.40.51 ether=08aefc2b2431
		sys=ourprinter dom=ourprinter.dept.company.com
		bootf=/lib/tftpd/66.120.40.51		# so dhcpd will respond to it
		printhost=ourcpu printlangs=ps2

And yes, I did make a stab at replacing lp, on Inferno even.  It's not
a trival job, but it's not rocket science either.



             reply	other threads:[~2001-10-27  0:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-27  0:10 geoff [this message]
  -- strict thread matches above, loose matches on Subject: below --
2001-10-29  5:16 Paul
2001-10-26 22:21 Scott Schwartz
2001-10-26 20:12 Russ Cox
2001-10-26 20:07 presotto
2001-10-26 17:19 peh
2001-10-26 16:06 peh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0GLU00HWE8HO5F@mta5.snfc21.pbi.net \
    --to=geoff@collyer.net \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).