[comp.unix.wizards] System V lp setup

jdm@gssc.UUCP (03/04/87)

i hereby cuss and swear vehemently at the UNIX System V (read 3B2) lp setup.
more precisely, lpadmin and the whole /usr/spool/lp directory.

when trying to bring up a new printer (a laserwriter) one cannot write a new
model and stuff it in the .../lp/model directory and specify it as a new
model.  it seems as though lpadmin is HARD CODED to a handful of not very
useful model types.  

furthermore, if i delete the pstatus and qstatus files, i would expect that
they would be recreated as necessary by SOME command, like lpadmin or even
accept.  but they all complain that they can't open the file, or that the
printer has "disappeared."

in short, lpadmin is a pain, and the System V manuals don't make it any easier.
i have NO documentation on the contents of the /usr/spool/lp directory (at
least not that i know of, as all things are hard to find in the "new and
improved" at&t manuals) except what is in the lpadmin man page.

i think that my basic gripes boil down to this:  
	1. lpadmin should not be hardcoded with the model names, and
	2. the new System V manuals are AWFULL!!!!  the original, spiral-bound
	manuals were great, by comparison, except that they fell apart.  

i vehemently oppose spreading the same information over MANY manuals.
PLEASE go back to the following manual structure:
	Volume 1. the the level 1 commands
	Volume 2. the 2 through 8 man-page levels 
	Volume 3. the memorandum papers on advanced topics
	Volume 4. the tutorials
	Volume 5. hardware specific setup

i don't really care about the numbering scheme, i just HATE wasting time to 
search all over for a man page, or any other info i'm looking for.

anyone have any comments?  (you might mail personal flames, but truly useful
info would be welcome on the net, i'm sure.)  =)

-- jdm

-- 
in real life:  John D. Miller, Graphic Software Systems, Inc., Beaverton OR
...!{tektronix!verdix}!sequent!gssc!jdm

jmc@ptsfa.UUCP (03/06/87)

In article <343@gssc.UUCP> jdm@gssc.UUCP (John D. Miller) writes:

>in short, lpadmin is a pain, and the System V manuals don't make it any easier.

There IS a tutorial on lp. For example, see Chapter 7, LP spooling system
in your "administrator's guide". 

>	1. lpadmin should not be hardcoded with the model names, and

It is not. You can create any model you like. For example, the tutorial
has sections on "introducing new destinations", "printer interface programs"
etc. By the way, you are right about the pstatus and qstatus files not
being automagically created. A definate hole in the system.

>	2. the new System V manuals are AWFULL!!!!...

You are missing some manuals. The full set is not perfect by any means but
some parts are improved from the pre V.2 versions.

>i vehemently oppose spreading the same information over MANY manuals.

There should definately be a reorganization, or at least, a ROADMAP.
Part of my problem is finding the right manual. My personal flame 
concerns making the manuals so small. Most should be 81/2 x 11 so there
would be fewer of them. I've got almost a linear YARD of manuals.

-- 
voice= 415 823-2441
uucp={ihnp4,dual,qantel}!ptsfa!jmc

metro@asi.UUCP (03/07/87)

In article <343@gssc.UUCP>, jdm@gssc.UUCP (John D. Miller) writes:
> i hereby cuss and swear vehemently at the UNIX System V (read 3B2) lp setup.
> more precisely, lpadmin and the whole /usr/spool/lp directory.
> 

I have found the LP spooler system to be very powerful, and able to handle
every requirement we have had.  This includes multiple printers, and multiple
forms queue for each and any printer.  

> when trying to bring up a new printer (a laserwriter) one cannot write a new
> model and stuff it in the .../lp/model directory and specify it as a new
> model.  it seems as though lpadmin is HARD CODED to a handful of not very
> useful model types.  

I have experienced this problem also.  However, I found that setting the mode,
owner, and group to the same settings as the supplied models corrected the 
problem.  Also, I believe if you use the "-i<filename>" option, lpadmin will
read the interface from the specified file (I.E. current directory).

> 
> furthermore, if i delete the pstatus and qstatus files, i would expect that
> they would be recreated as necessary by SOME command, like lpadmin or even
> accept.  but they all complain that they can't open the file, or that the
> printer has "disappeared."

Sorry, I am not familiar with these files.  I tend to let LP handle modifying
its own files.

> 
> in short, lpadmin is a pain, and the System V manuals don't make it any easier.

It is some what obscure.  However in the Utilities Volume ?? manual is a
fairly extensive discussion of the LP System.

> i have NO documentation on the contents of the /usr/spool/lp directory (at
> least not that i know of, as all things are hard to find in the "new and
> improved" at&t manuals) except what is in the lpadmin man page.
> 

> Bitch, Bitch, Bitch.
>
> in real life:  John D. Miller, Graphic Software Systems, Inc., Beaverton OR
> ...!{tektronix!verdix}!sequent!gssc!jdm

If you have any questions, I would be more than will to give you a hand.
-- 
Metro T. Sauper, Jr.                              Assessment Systems, Inc.
Director, Remote Systems Development              210 South Fourth Street
(215) 592-8900                                    Philadelphia, PA 19106

larry@kitty.UUCP (Larry Lippman) (03/07/87)

In article <343@gssc.UUCP>, jdm@gssc.UUCP (John D. Miller) writes:
> i hereby cuss and swear vehemently at the UNIX System V (read 3B2) lp setup.
> more precisely, lpadmin and the whole /usr/spool/lp directory.

	I beg to differ.  I have used the Sys V lp spooler with excellent
results on three Sys V ports: AT&T for the 3B2, UniSoft Uniplus+, NCR for
the Tower XP and Tower 32.  I have written a variety of custom interface
programs for mechanical printers, the Xerox 4045 laser printer (like a 2700),
H-P plotters, and (believe it or not) a speech synthesizer and a robot, all
of which use the lp spooler to schedule jobs.

> when trying to bring up a new printer (a laserwriter) one cannot write a new
> model and stuff it in the .../lp/model directory and specify it as a new
> model.  it seems as though lpadmin is HARD CODED to a handful of not very
> useful model types.  

	No way is the model selection hard coded!  The model is chosen by the
``-m'' option of lpadmin(1M), and is selected from the files present in the
directory /usr/spool/lp/model.  You wanna create an interface program for a
new model to be selected by the ``-m'' option, just install your program in
this directory.
	If you want to install a new model program, you don't even have to
select from a pre-existing model; just use the ``-i [pathname]'' option of
lpadmin(1M) to install an interface program from a file kept anywhere on
your system!

> furthermore, if i delete the pstatus and qstatus files, i would expect that
> they would be recreated as necessary by SOME command, like lpadmin or even
> accept.  but they all complain that they can't open the file, or that the
> printer has "disappeared."

	In general, you should never mess with the pstatus and qstatus files.
If you have messed with them, and have screwed up the lp spooler, your best
bet is to save any custom interface programs, delete all of the files in
/usr/spool/lp, and re-install the lp spooler software.  If you have a 3B2,
this is simple process done by inserting the lp spooler distribution diskette,
and typing ``sysadm installpkg''.  Then you can use lpadmin(1M) to rebuild the
lp spooler.

> in short, lpadmin is a pain, and the System V manuals don't make it easier.
> i have NO documentation on the contents of the /usr/spool/lp directory (at
> least not that i know of, as all things are hard to find in the "new and
> improved" at&t manuals) except what is in the lpadmin man page.

	You say you have a 3B2.  With Sys V Release 1.x (which no one ought
be running anymore!), the "Line Printer Spooling Manual" 305-332 did a
decent job of explaining lp spooler operation, although it didn't explicitly
say much about the /usr/spool/lp file structure.  With Sys V Release 2.x,
the updated manual 305-430 was much improved and has a whole section that
explains the file and directory functions.  How can you be running a 3B2
with an lp spooler and NOT have these manuals?

> i think that my basic gripes boil down to this:  
> 	1. lpadmin should not be hardcoded with the model names, and
> 	2. the new System V manuals are AWFULL!!!!  the original, spiral-bound
> 	manuals were great, by comparison, except that they fell apart.  
> i vehemently oppose spreading the same information over MANY manuals.

	This is simply not true.  I beg to differ with your reference to
``MANY'' manuals.  There is one distributed manual, mentioned above.  That
is your lp spooler manual; you take the (1) and (1M) pages and put 'em the
appropriate (1) and (1M) manuals.  Period.
	I have lack-of-decent-documentation gripes against AT&T and Sys V
(like ipc and the graphics utilities), but it sure as hell ain't with the
lp spooler!

<>  Larry Lippman @ Recognition Research Corp., Clarence, New York
<>  UUCP:  {allegra|ames|boulder|decvax|rocksanne|watmath}!sunybcs!kitty!larry
<>  VOICE: 716/688-1231        {hplabs|ihnp4|mtune|seismo|utzoo}!/
<>  FAX:   716/741-9635 {G1,G2,G3 modes}    "Have you hugged your cat today?" 

john@polyof.UUCP (03/12/87)

In article <343@gssc.UUCP>, jdm@gssc.UUCP writes:
> i hereby cuss and swear vehemently at the UNIX System V (read 3B2) lp setup.
> when trying to bring up a new printer (a laserwriter) one cannot write a new
> model and stuff it in the .../lp/model directory and specify it as a new
> model.  it seems as though lpadmin is HARD CODED to a handful of not very
> useful model types.  
> -- jdm

Granted, the '-m' option may not be what YOU want.  We configured several
special printers, none of which matched the given models; you must use
the '-i' option. (LPADMIN(1M)).  For example,
	$ /usr/lib/lpadmin -plaser -v/dev/tty10 -i/usr/spool/lp/model/MYLASER_MODEL

/usr/spool/lp/model/MYLASER_MODEL is the shell - script which will be
used as the 'model'.

Perhaps this is not crystal clear (I think it is) in the documentaion.
[LPADMIN(1M), subheading "Restrictions"]

Could also be that your 'lpadmin' command is broken; ours is on System V on
a PDP11/70.

John Buck
Polytechnic University
Route 110
Farmingdale, NY 11735
iguana!polyof!john
rti-sel!polyof!john
motown!mergvax!inthap!polyof!john

jewett@hpl-opus.HP.COM (Bob Jewett) (03/16/87)

> > model.  it seems as though lpadmin is HARD CODED to a handful of not very
> 
> you must use > the '-i' option. (LPADMIN(1M)).  For example,

    I thought I had this same problem on my HP-UX (SYS V) system.  In fact
    the problem is that any model must be owned by lp (and group bin?).
    Try changing ownership of the files in ~lp/model and see if -m works.

    Bob Jewett

stewart@houxm.UUCP (Bill Stewart HO 4K-435 x0705) (03/19/87)

In article <1990001@hpl-opus.HP.COM>, jewett@hpl-opus.HP.COM (Bob Jewett) writes:
: > > model.  it seems as though lpadmin is HARD CODED to a handful of not very
: > 
: > you must use > the '-i' option. (LPADMIN(1M)).  For example,
: 
:     the problem is that any model must be owned by lp (and group bin?).
:     Try changing ownership of the files in ~lp/model and see if -m works.

lpadmin is also picky about the file permissions; make the ownership
and permissions the same as other model files and it'll work.

What annoys me about the lp system is that "lp" runs setuid lp;
this means you can't lp a file from a directory with 700 permissions
or a file with 600 permissions - you have to feed lp the file as stdin.
A setgid program would occasionally have this problem, but much less often.
have problems (e.g. for a file 
-- 
Bill Stewart	ho95c!wcs AT&T Bell Labs, Holmdel NJ
HO 4K-435 x0705   (201-949-0705)
{allegra, ucbvax!ihnp4, decvax!harpo}!houxf!stewart

brandon@tdi2.UUCP (03/20/87)

Quoted from <219@polyof.UUCP> ["Re: System V lp setup"], by john@polyof.UUCP...
+---------------
| In article <343@gssc.UUCP>, jdm@gssc.UUCP writes:
| > i hereby cuss and swear vehemently at the UNIX System V (read 3B2) lp setup.
| > when trying to bring up a new printer (a laserwriter) one cannot write a new
| > model and stuff it in the .../lp/model directory and specify it as a new
| > model.  it seems as though lpadmin is HARD CODED to a handful of not very
| > useful model types.  
| > -- jdm
| 
| Granted, the '-m' option may not be what YOU want.  We configured several
| special printers, none of which matched the given models; you must use
| the '-i' option. (LPADMIN(1M)).  For example,
| 	$ /usr/lib/lpadmin -plaser -v/dev/tty10 -i/usr/spool/lp/model/MYLASER_MODEL
+---------------

I have the same complaint.  Certainly you can use -i -- but which is easier
to type?

I now use -e since I use a generic model program written in C and driven off
a pcap file; also looking up config information in a config file for each
printer, to control banners, special forms, etc.  (The major difference
between my setup and printcap is that mine uses arrays:

#
# PCap for Radio Shack LMP-2150 using lpVdriver under System V spooler
#

lmp2150:
	print-modes = 5,
	print-mode = <"80", "96", "132", "wp", "corr">,
	width = <80, 101, 132, 80, 80>,
	RS-backspace,
	RS-bs-width = <12, 12, 12, 20, 20>,
	reset = "\E^T^S",
	default-mode = 2,
	set-mode = <"\E^S^S",
		    "\E^W^S",
		    "\E^T^S",
		    "\E^R^T",
		    "\E^R^S">,
	no-formfeed.

Thus, adding new print modes doesn't take a rewrite of the model program, it
just uses "print-modes" as the maximum index and gets the right mode by
checking its mode argument (passed with -o:  -owp) against the array
print-mode.  (RS-backspace is due to the fact that the LMP backspaces by the
number of dots specified in the next character:  ^H^L is an 80-column (normal
mode) backspace.)

Since I always use this model, I just specify -e(name of existing printer) to
install a new printer with this model.  But I would prefer to use -mlpVdriver
instead.

++Brandon
-- 
``for is he not of the Children of Luthien?  Never shall that line fail, though
the years may lengthen beyond count.''  --J. R. R. Tolkien

Brandon S. Allbery	           UUCP: cbatt!cwruecmp!ncoast!tdi2!brandon
Tridelta Industries, Inc.         CSNET: ncoast!allbery@Case
7350 Corporate Blvd.	       INTERNET: ncoast!allbery%Case.CSNET@relay.CS.NET
Mentor, Ohio 44060		  PHONE: +1 216 255 1080 (home) +1 216 974 9210

paddock@melpad.UUCP (03/22/87)

There has been much discussion of how to add nonstandard printer interfaces
to the Unix System V lp system.  An AT&T technician here showed me the
cleanest trick I have found.  Configure the printer as to port and name
using one of the default interfaces.  Then, as root, replace the
file with the name you just assigned in /usr/spool/lp/interface with
your custom interface.
-- 
Steve Paddock
{ihnp4,allegra,ut-sally}!ut-ngp!melpad!paddock

geller@eli.UUCP (David Geller) (03/23/87)

In article <207@melpad.UUCP>, paddock@melpad.UUCP (5 Steve Paddock) writes:
> There has been much discussion of how to add nonstandard printer interfaces
> to the Unix System V lp system.  An AT&T technician here showed me the
> cleanest trick I have found.  Configure the printer as to port and name
> using one of the default interfaces.  Then, as root, replace the
> file with the name you just assigned in /usr/spool/lp/interface with
> your custom interface.

Am I missing something or what? The System V spooler facility clearly
defines and provides a mechanism for adding a new "filter." Why go in
a start changing file names. What happened to using the lpadmin program
with argument like -p, -v and -m (for your interface). If I'm in the
dark please turn on the light. I've got the manual right here and
everything seems very easy...

David Geller
Electric Logic, Inc.
Washington, D.C.

rbj@icst-cmr.arpa (03/31/87)

   2. the new System V manuals are AWFULL!!!!  the original, spiral-bound
	   manuals were great, by comparison, except that they fell apart.  

   anyone have any comments?

Definitely! I scanned the SVr2v2 manuals. Yuk! I suppose renumbering the
sections doesn't really make a difference, but why bother. The VI reference
was incomplete, and an appendix claiming to list commands `in alphabetical'
order sure munged up the punctuation.

But worst of all was the omission of the paper `Unix Programming', aka
document #17 in Volume 2A. How the fsck do you learn to program without
reading that thing? If TPC wants to include papers written at Dick and
Jane level, that's ok, but NOT AS REPLACEMENTS! Some things just can't
be improved upon.

Oh, yeah. The binders are those little ones, the same size that DEC
uses for VMS.  Even the SVr1 binders that were the correct size had
completely incompatibly spaced rings. Is this a conspiracy so you
won't throw the documentation away just for the binders? Some Standard!

   in real life:  John D. Miller, Graphic Software Systems, Inc., Beaverton OR
    ...!{tektronix!verdix}!sequent!gssc!jdm

	(Root Boy) Jim "Just Say Yes" Cottrell	<rbj@icst-cmr.arpa>
Hmmm..a CRIPPLED ACCOUNTANT with a FALAFEL sandwich is HIT by a TROLLEY-CAR..

Disclaimer: I speak not for NBS, but for myself.