9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Russ Cox <russcox@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu>
Subject: Re: [9fans] Newbie question on printing
Date: Tue, 26 Jul 2005 07:03:04 -0400	[thread overview]
Message-ID: <ee9e417a05072604036c08a45d@mail.gmail.com> (raw)
In-Reply-To: <a4c804f3a724d439eddc70a000986338@tombob.com>

Modern Unix printing is a catastrophe.  Plan 9 printing is only a mess.

Lpd is in fact for spooling and queueing on a host machine.
If your printer were shared among lots of people and had
some machine handling its queue, then you'd want to use the
"vogon" example line in /sys/lib/lp/devices:

> clp550n robbys-room     prunelle        clp550n -       post+600dpi     generic lpdspool        lpd     -       -       FIFO

That would print to the spool named clp550n on the machine prunelle.
If your own machine is named prunelle, then that's just going to make
a nice loop that never gets to the printer.

> clp550n robbys-room     prunelle        tcp!clp550n!9100        81920   post+600dpi                     generic         generic         generic         generic         tcppost         FIFO
> 
> But now I am getting timeouts from tcpostio; so my guess is that port
> 9100 isn't quite right or the protocol has shifted.

This is very close to correct.  Port 9100 is the JetDirect port
and is what you want.  It's not clear to me that tcppost is doing
the right thing, though.  Most likely it's for a printer protocol from
an earlier time.

Try putting this script in /sys/lib/lp/daemon/jetdirect and see if it
works better.

#!/bin/rc
generic '{aux/download -f -H/sys/lib/postscript/font -mfontmap -plw+ <
$LPDEST/$FILE(1); echo -n `{unicode 4}} | con $OUTDEV >[2]$PRINTLOG'
'{cat <{echo -d$LPDEST -pnoproc -M^$SCHEDLINE(1) -u^$SCHEDLINE(2)}
$LPDEST/$FILE(1);sleep 5} | lpsend.rc $DEST_HOST' ''

(This is just tcppost except that I've replaced 
"aux/tcpostio -b^$SPEED $OUTDEV" with "con $OUTDEV"
and added a ^D to the end of the file being sent.)

Failing that, you might try and see if

{lp -dstdout file.ps; echo -n `{unicode 4}} | con tcp!clp550n!9100 

actually does the right thing.  It should.
Once we get to a script that works for jetdirect I'll add
it to the distribution.

Russ


      parent reply	other threads:[~2005-07-26 11:03 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-26 10:29 Robert Raschke
2005-07-26 10:57 ` Steve Simon
2005-07-26 11:05   ` Russ Cox
2005-07-26 11:33     ` Robert Raschke
2005-07-26 12:06       ` Russ Cox
2005-07-26 15:46         ` Jack Johnson
2005-07-26 15:59           ` Russ Cox
2005-07-26 16:07           ` Ronald G. Minnich
2005-07-26 16:35             ` Jim McKie
2005-07-26 16:55               ` Jack Johnson
2005-07-26 17:28                 ` Ronald G. Minnich
2005-07-26 18:49               ` andrey mirtchovski
2005-07-26 16:44             ` Jack Johnson
2005-07-26 11:03 ` Russ Cox [this message]

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=ee9e417a05072604036c08a45d@mail.gmail.com \
    --to=russcox@gmail.com \
    --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).