Subject: RE: lpr -P bug as reported earlier with detailed test results etc...
To: netbsd-bugs@NetBSD.ORG <netbsd-bugs@NetBSD.ORG>
From: Burns, Scott <scott.burns@labatt.com>
List: netbsd-bugs
Date: 05/05/1996 11:57:33
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.  Contact your
mail administrator for information about upgrading your reader to a version
that supports MIME.

------ =_NextPart_000_01BB3A7A.0C289D30
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit

Regarding my earlier post about the "lpr" problem in relation to the PRINTER
environment variable and the "-P" option. I would think that if the -P option
is specified it should override any setting of the PRINTER environment variable.
This is the premise of my problem report. Does everyone agree this should be the
operation of PRINTER and -P on lpr ? Sorry my Gnats access is still a couple of
months away.

Here are some more detailed examples which I think backup my point. I have not had
a chance to re-examine my code submitted last time for the bugs you reported.

------------------------------------------------------------------------------------
P.S. Theo (of OpenBSD fame) sent me a private e-mail, including patches,
 reporting he had replicated the problem and also found the same bug in:

	lpq, lprm, and pac

(Thanks Theo, I had not dug that far yet).
------------------------------------------------------------------------------------

ncti20 is the host on which the testing is being performed. ncti100 is another
host on the same net which I am using as a test remote queue host.

Both are running the same revision of NetBSD:

NetBSD ncti20.ncti.com 1.1 NetBSD 1.1 (NCTI20) #0: Sat Apr  6 16:48:12 PST 1996
NetBSD ncti100.ncti.com 1.1 NetBSD 1.1 (NCTI100) #0: Sat Apr  6 16:48:12 PST 1996

ncti20# unsetenv PRINTER
********-> The default printer environment variable is not set as of now.

ncti20# cat /etc/printcap
#       @(#)printcap    5.3 (Berkeley) 6/30/90

lp|local line printer:\
        :lp=/dev/lpt0:sd=/var/spool/lpd:lf=/var/log/lpd-errs:
lp2|local line printer 2:\
        :rm=ncti100:sd=/var/spool/lpd:lf=/var/log/lpd-errs:

********-> The above is the printcap on the machine I am testing on. /dev/lpt0
	has no printer, nor does the "lp" queue exist on the ncti100 machine but
	it should not matter for the test. So I have two queues for the test
	"lp" is local and "lp2" is remote.

------------------------------------------------------------------------------------

ncti20# lpr /etc/printcap

********-> Now I am sending a job without PRINTER set and with no -P option
	so it should go to the default "lp" queue.

ncti20# lpq
waiting for lp to become ready (offline ?)
Rank   Owner      Job  Files                                 Total Size
1st    root       8    /etc/printcap                         198 bytes

********-> It did indeed go to the "lp" queue. That is working properly.

ncti20# lprm 8
dfA008ncti20.ncti.com dequeued
cfA008ncti20.ncti.com dequeued

********-> Kill that test job.

------------------------------------------------------------------------------------

ncti20# lpr -P lp2 /etc/printcap

********-> Now try specifying the "lp2" queue with "-P"

ncti20# lpq
waiting for lp to become ready (offline ?)
Rank   Owner      Job  Files                                 Total Size
1st    root       9    /etc/printcap                         198 bytes

********-> It went to the "lp" queue again even though I had specified "-P lp2" on
	the lpr command line. This is NOT working properly.

ncti20# lprm 9
dfA009ncti20.ncti.com dequeued
cfA009ncti20.ncti.com dequeued

********-> Kill that test job.

----------------------------------------------------------------------------------

ncti20# setenv PRINTER lp2


********-> Set the default queue via the PRINTER environment variable to "lp2"

ncti20# lpr /etc/printcap

********-> Send a print which should use the PRINTER environment variable.

ncti20# lpq
ncti20.ncti.com: waiting for lp to become ready (offline ?)
Rank   Owner      Job  Files                                 Total Size
1st    root       10   /etc/printcap                         198 bytes

ncti100.ncti.com: lpd: lp: unknown printer

********-> It went to the "lp2" queue this time (See the ncti100 reference below
	the queue listing). This is working properly.


ncti20# lprm 10
dfA010ncti20.ncti.com dequeued
cfA010ncti20.ncti.com dequeued
ncti100.ncti.com: lpd: lp: unknown printer

********-> Kill the test job.

--------------------------------------------------------------------------------------

ncti20# lpr -P lp /etc/printcap

********-> Now try and override the PRINTER env. setting of "lp2" with a
	"-P" option of "lp".

ncti20# lpq
ncti20.ncti.com: waiting for lp to become ready (offline ?)
Rank   Owner      Job  Files                                 Total Size
1st    root       11   /etc/printcap                         198 bytes

ncti100.ncti.com: lpd: lp: unknown printer

********-> The print job went to "lp2" and lpr appears to have ignored the
	"-P lp" option I specified. This is NOT working properly.

Thanks for your time and sorry again for not using Gnats to log this.
The reason I am concerned about this is I am setting up another
6 NetBSD boxes to train these people on Unix / lp / lpr for a production
system running on Sun boxes.

P.S. Nice to see another fellow Canadian using NetBSD ;-)

Scott
Scott.Burns@Labatt.Com

------ =_NextPart_000_01BB3A7A.0C289D30--