4.2 Printer Spooler Question (long answer)

Roger Southwick rogers at athena.UUCP
Tue Aug 27 03:35:38 AEST 1985


[Do not meddle in the affairs of Unix, for it is subtle and quick to anger.]

> We would like to hook up a HP laser jet printer to the spooler in
> a special way. I would like to create two queues, by two different
> names, with different spool directories and different output
> filters. All this works fine, but if you enable printing on both
> at once you get multiplexed output!! Is there anyway to set this
> up, so that the device is shared properly and output files don't
> get stepped on. Today we must stop printing on one queue to start
> the other.

Hello there... I'll hope that you don't get hoards of these sorts of
answers. 

To start, I'll assume that you are using the same 'lp=/dev/foo' in
both entries in your /etc/printcap.  The problem is that setting up
a new queue says that there are multiple lock files for the device,
and the spooler assumes that if you send something to queue A, then
something to queue B, that both device A & B are open (not locked).

To solve this, use a line like:

	:lo=../QUEUENAME/lock: 

on all but one of your entries.  Thats how I fixed it.  For example
here is a portion of our /etc/printcap where I have set up 3 queues
and 3 filters for one device:


lprw|lp|Wide Line Printer:\
	:lp=/dev/lprw:\
	:sd=/usr/spool/lpd/lpwide:\
	:lf=/usr/spool/lpd/ERRORLOG:\
	:af=/usr/adm/lpdacct:\
	:if=/usr/lib/local/filters/printronix:\
	:gf=/usr/lib/gpf:\
	:of=/usr/lib/lpf:\
	:tr=\n\f:\
	:pq=lpwide:\
	:br#9600:
lpsloww|lps|Slow Wide Line Printer:\
	:lp=/dev/lprw:\
	:sd=/usr/spool/lpd/lpsw:\
	:lo=../lpwide/lock:\
	:lf=/usr/spool/lpd/ERRORLOG:\
	:af=/usr/adm/lpdacct:\
	:if=/usr/lib/local/filters/printronix:\
	:gf=/usr/lib/gpf:\
	:of=/usr/lib/local/filters/lpf_slow:\
	:tr=\n\f:\
	:pq=lpsw:\
	:br#9600:
lafastw|lpf|Fast Wide Line Printer:\
	:lp=/dev/lprw:\
	:sd=/usr/spool/lpd/lpfw:\
	:lo=../lpwide/lock:\
	:lf=/usr/spool/lpd/ERRORLOG:\
	:af=/usr/adm/lpdacct:\
	:if=/usr/lib/local/filters/printronix:\
	:gf=/usr/lib/gpf:\
	:of=/usr/lib/local/filters/lpf_fast:\
	:tr=\n\f:\
	:pq=lpfw:\
	:br#9600:

Hope that solves your problem.

	-Roger



More information about the Comp.unix mailing list