From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: Date: Tue, 26 Jul 2005 07:03:04 -0400 From: Russ Cox To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu> Subject: Re: [9fans] Newbie question on printing In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: Topicbox-Message-UUID: 6f0a3262-ead0-11e9-9d60-3106f5b1d025 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 g= eneric 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 p= ost+600dpi generic generic generic = generic tcppost FIFO >=20 > 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=20 "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=20 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