Dave Lovelace makes the 'yet another feature' list...

Sigh...

Release LPRng 3.7.1 - Sun Nov  5 11:56:40 PST 2000
 lp -f formname now makes the CLASS information 'formname' as well.
   (Inspired by: Dave Lovelace <[EMAIL PROTECTED]>)

> From [EMAIL PROTECTED] Fri Oct 27 12:26:25 2000
> From: Dave Lovelace <[EMAIL PROTECTED]>
> Subject: LPRng: SYSV-style forms management
> To: [EMAIL PROTECTED]
> Date: Fri, 27 Oct 2000 14:25:46 -0400 (EDT)
>
> I'm pretty new to this list, & to LPRng.  I've got it up and working,
> basically.  (I didn't have any problems to compare with the kinds of
> things most of you folks have discussed!)  However, there are some
> things I don't see how to do.  I've at least skimmed through the entire
> HOWTO, and searched for keywords every which way, without finding what
> I'm looking for - though I suspect that it's actually not really hard,
> it isn't the kind of issue that's come up, apparently.  (All the stuff
> involving queues on multiple hosts, etc., is **way** beyond our needs
> now.)

Yeah... right...
>
> I have no background in using bsd-style printing beyond what I've found
> so far in setting stuff up, before we located LPRng.  So I'm pretty
> ignorant of the background presupposed by most of the LPRng doc.
>
> Here's the situation.  We are migrating stuff from a reasonably
> standard SYSV Unix system, where lp/lpsched/lpstat/lpadmin rules, to
> Linux.  The standard bsd-style lpr/lpd setup lost us **way** too many
> features that are coded all over into scripts etc., and in looking
> around we found LPRng.  It looks like major overkill, but I'm fairly
> sure it will do everything we need, at least with a few changes.
>
> Now, one thing we are still supporting is printing (on impact
> lineprinters, but that's another question) on continuous, pre-printed
> forms.  We can create a form, give it an alignment pattern, and then
> queue up jobs with a command such as
>
>       lp -d someprinter -f formname ... printfile
>
> The system holds this job, and any others queued with the -f option, in
> the queue, but lets any queued without this option go ahead and print.
> Then we mount the form.  We disable the printer ("stop" it, in
> lpr/lpd-speak, I think) so that nothing at all is printing, tell the
> operator to insert the forms, and issue a command (as root):
>
>       lpadmin -p someprinter -M -f formname -a
>
> (omitting the "-a" if there is not in fact an alignment pattern, but
> there normally is).  This does two things:
>
> 1. It registers the form as mounted, so that when the printer
>    is enabled ("start"ed), all and only jobs queued up for this
>    specific form will print.
>
> 2. Because of the -a, it queues up an immediate job (implemented
>    as a pipe, as it happens) which sends an alignment pattern to the
>    printer, and goes into a loop prompting the operator to say whether
>    another alignment pattern is needed.
>
> When all (any) desired alignment patterns have been printed, we
> re-enable ("start") the printer so that jobs with this form (and only
> they) will print, while other jobs are held in the queue.  (So we may
> at this point queue up other jobs for this form, and they print, or
> other jobs for no form or for other forms, and they do NOT print yet.)
>
> Finally, we reverse the process, mounting (no alignment) the
> pseudo-form-name "none", which allows jobs queued with no "-f" option
> to print.
>
> I see from the doc that "lp -f formname" is implemented by setting
> something called the "print format" (discussed in the HOWTO (version
> I'm reading, anyway) in section 6.2) to the first character of
> formname.  OK, we don't (normally) have enough forms that we can't be
> creative in nameing them, I hope.  And if I need to, I **think** I can
> probably write something to manage sending the alignment patterns,
> etc.  What I don't see is how to configure things to automatically hold
> all jobs for our special forms, then to tell it to print the jobs for
> one particular form but hold all others.  I'm also concerned about the
> overloading of this field; these are normally text jobs, but in a few
> cases they are binary, in which case the format type would have to be
> "b" or "l", right?  (Depends on the physical printer whether this is a
> factor.)
>
> Sorry this is so long & complex, but I'm totally at a loss, & trying to
> ask it in short, self-contained questions appeared to me to only be
> confusing.  Any help anyone can give is MUCH appreciated!
>
> (I'll reserve other, tangentially-related questions, for other
> messages.)
>
> -- 
> - Dave Lovelace
>   [EMAIL PROTECTED]
>   [EMAIL PROTECTED]

There is a similar facility in LPRng.  It uses the notions
of 'job class', or more properly,  'job characteristics'.  You can
set the class of a job using:
  lpr -C class

Unfortunately,  the LPRng 'lp' support does not pass the 'lp -f formname'
as the class information.  You can add this to the lpr.c code:

in common/lpr.c, around line 332 you have:

        case 'D':   Parse_debug(Optarg,1);
                    break;
        case 'f':   Format_JOB = *Optarg;
                    break;
        case 'H':   /* special handling - ignore */
                    break;

Modify this to be:

        case 'D':   Parse_debug(Optarg,1);
                    break;
        case 'f':   Classname_JOB = Optarg;
                    break;
        case 'H':   /* special handling - ignore */
                    break;

(This has been done for LPRng-3.7.1)

Now you can use the 'lpc class' command to control what jobs
are printed.

Suppose that you have two forms:  'long' and 'short' (I am making
these names up).

To have only jobs submitted by 'lpr -C long' or 'lp -f long' print,
you use:

   lpc class PRINTER long

To have only jobs submitted by 'lpr -C short' or 'lp -f short' print,
you use:

   lpc class PRINTER short

You turn the 'class restriction' stuff off and print any job by using

   lpc class PRINTER off

(Yes, yes,  you cannot have a class with the name 'off'.  Tough.)

Now how to print your alignment job:

lpr -C align file.with.alingment stuff
lpc class PRINTER align
lpc start PRINTER        <<< this may be optional

and when you get the alignment done:

lpc class PRINTER long    (or short).


Patrick Powell                 Astart Technologies,
[EMAIL PROTECTED]            9475 Chesapeake Drive, Suite D,
Network and System             San Diego, CA 92123
  Consulting                   858-874-6543 FAX 858-279-8424 
LPRng - Print Spooler (http://www.astart.com)

-----------------------------------------------------------------------------
YOU MUST BE A LIST MEMBER IN ORDER TO POST TO THE LPRNG MAILING LIST
The address you post from MUST be your subscription address

If you need help, send email to [EMAIL PROTECTED] (or lprng-requests
or lprng-digest-requests) with the word 'help' in the body.  For the impatient,
to subscribe to a list with name LIST,  send mail to [EMAIL PROTECTED]
with:                           | example:
subscribe LIST <mailaddr>       |  subscribe lprng-digest [EMAIL PROTECTED]
unsubscribe LIST <mailaddr>     |  unsubscribe lprng [EMAIL PROTECTED]

If you have major problems,  send email to [EMAIL PROTECTED] with the word
LPRNGLIST in the SUBJECT line.
-----------------------------------------------------------------------------

Reply via email to