[comp.unix.xenix] Reserving the printer

dws@cseg.uucp (David W. Summers) (05/26/89)

I have a question that I've not seen anyone address before.  I would like to be
able to lock out the automatic spooling of print jobs and reserve the printer
for my program's use until it is finished printing and then have the normal
print spooling take effect again, preferrably (sp?) with the least amount of
interference with the printer spooler 'lpsched' and the 'lp' command.  This will
be used for things like immediate printing without going through the print
spooler, printing forms tests, and things like that.  Does anyone have a clue
as to the the printer lockout procedure for the normal 'lp' and 'lpsched'
commands that I could use?

   Please e-mail replies and I'll post a summary if there is enough interest.
Any help, ideas, suggestions will be greatly appreciated.

   - David Summers
   (dws@cseg.uucp)
   (..!harris.cis.ksu.edu!hcx!cseg!dws)

woods@eci386.uucp (Greg Woods) (05/27/89)

In article <2465@cveg.uucp> dws@cseg.uucp (David W. Summers) writes:
> 
> I have a question that I've not seen anyone address before.  I would like to be
> able to lock out the automatic spooling of print jobs and reserve the printer
> for my program's use until it is finished printing and then have the normal
> print spooling take effect again [....]

WHY?  If you want to share the printer, you have to respect the
protocol for doing so.

If you want exclusive access to the printer device, you MUST
disable the scheduler, or prevent it from using the particular
device.  To do this you must have "lpadmin" privileges and use the
commands documented and supplied for doing so.

If this is not sufficient, then perhaps you might consider writing
a new spooler package, adapting a "PD" version, or buying a third
party solution.

Admittedly one could eventually deduce the scheme lpsched uses to
enable and disable printers, etc.  However to do this will be
difficult, and will make your system dependent upon the current
version of the spooler.  I can tell you for a fact that the System V
Release 3.2 spooler is significantly different than the previous
versions, and may in fact provide the functionality you desire in
a more palatable manner.

If you are trying to design a method for managing different
"forms" on a single printer, and you want it to work with the
pre-SysVr3.2 spoolers, might I suggest using classes.  Print jobs
may be queued to a particular printer "class" which may represent a
certain form.  When this form is loaded into the printer, this
class may be enabled and those jobs will be printed.  While the
printer is disabled during the forms loading, alignment output may
be sent to the printer device directly to facilitate forms loading.
However since this will likely always be done by a human, human
intervention to the spooler is not so big an obstacle.
-- 
						Greg A. Woods

woods@{{utgpu,eci386,ontmoh,tmsoft}.UUCP,gpu.utcs.UToronto.CA,utorgpu.BITNET}
+1-416-443-1734 [h]  +1-416-595-5425 [w]		Toronto, Ontario CANADA