Subject: Need some help with printing on a LaserWriter IIg

From: "Morgan Reed" <[email-masked]>
Date: Tue, 30 May 2000 01:04:47 -0400

Werner,

	First, let me say thank you for your excellent and very clear HowTo;  Even
though my box is a Debian install with some differences in the netatalk
files placement, your guide was excellent in telling me WHY a certain file
was a certain place, something rare in many HowTos.

I am attempting to set up a laptop as a small print server for my home
network.  It is a 486 with Debian 2.1 installed.  Minimal services, but all
the important ones are working.  I am able to ping out, ping in, find my
laserWriter (though not a zone; as a note, if you edit your HowTo again, I
would suggest putting a note in there telling people that if their
laserWriter is not part of an established Appletalk network, then the
command getzones will be useless.  Instead, they will be able to correctly
identify their LaserWriter when they run nbplku. At least it worked for me
an one other person on the netatalk mailing list)

My problem is as follows:

I am able to send a print job to my laserwriter with pap (pap -p "MMLab IIg"
test.ps), however, if I try and use lpr, I get one of the following errors:

	job 'cfA679LinuxBox2.thereedfamily.org' transfer to lp@localhost failed
or
	job 'cfA680LinuxBox2.thereedfamily.org' tcp spooler is being used by(.....
I have not be able to re-duplicate this error, the first one appears
consistantly).

I did edit the services file to include the numbers and ports you specified
(even though I did not build it myself, and instead used the binary that is
downloaded with dselect in Debeian) and I edited my printcap with the
following:

lp|MMLab IIg:LaserWriter:\
	:lp=/dev/null:\
	:sd=var/spool/lpd/LaserWriterIIg:\
	:pl#63:pw#85:\
#	:mx#0:\
	:shsf:\
	:of=/usr/lib/atalk/filters/ofpap:

I have set up a directory in the lpd folder called LaserWriterIIg and the
filters are in the directory /usr/lib/atalk/filters/  and the ethernet name
of the printer is MMLab IIg.

What have I done wrong?

Another aside note,  My IIg printer won't rename from the ethertalk port.
If I hook it up to my mac via 8pin din, I can rename and the name will
stick, but when I put the ethertalk on, then rename, the printer software
"loses" the printer when I try to rename and then update.  No biggie.  I
have the printer select switch set to 4, should it be something else?

I am going to cc this messgae to the netatlk mailing list on the jhope that
this will either a) be solved quickly by someone on the list, or b)  if you
are able to solve it, I can post the results there.

Thank you,

Morgan Reed

---

From: "Lancaster, David Matthew" <[email-masked]>
Date: Tue, 30 May 2000 08:52:14 -0300 (ADT)

> I have not be able to re-duplicate this error, the first one appears

Might be a printcap error, or a spool directory problem.
Did you verify that lpd is running correctly?

My config for RH6 & LaserIIG is as follows:

[root@darkith /etc]# cat /etc/printcap
lp:\
        :sd=/var/spool/lpd/laser:\
        :lf=/var/log/lpd-errs:\
        :if=/usr/lib/filters/ifpap:\
        :of=/usr/lib/filters/ofpap:\
        :df=/usr/lib/filters/ofpap:\
        :lp=/dev/null:\
        :sh:\
        :sf:\
        :mx#0:\
        :pl#63:\
        :pw#85

[root@darkith /etc]# ls -al /usr/lib/filters/
total 8
drwxr-xr-x   2 root     root         1024 Sep  2  1999 .
drwxr-xr-x  36 root     root         7168 May 24 08:49 ..
lrwxrwxrwx   1 root     root           13 Feb 10 17:34 ifpap ->
/usr/sbin/psf
lrwxrwxrwx   1 root     root           13 Feb 10 17:34 ofpap ->
/usr/sbin/psf

[root@darkith /etc]# ls -al /var/spool/lpd/laser
total 7
drwxrwxr-x   2 root     lp           1024 May 15 22:09 .
drwxrwxr-x   3 root     daemon       1024 Sep  8  1999 ..
-rw-r--r--   1 root     root           16 Mar  6 22:27 .paprc
-rw-rw----   1 root     root           84 Apr 25 11:44 .railmag
-rw-r----x   1 root     lp              4 May 15 22:08 .seq
-------r--   1 root     root           20 May 15 22:08 lock
-rw-rw-r--   1 root     root           32 May 15 22:09 status

[root@darkith /etc]# cat /var/spool/lpd/laser/.paprc
LaserWriter IIg

I found that the formating in printcap is super-picky. Extra
spaces/carriage returns can even cause problems. I also note that you end
with a colon, which I did not. Perhaps a problem? You also have shsf
together, which I have seperated on two lines. Not sure if it's incorrect,
but I do know what worked for me.

Remember to do a "lpc restart all" after making changes to printcap. I
believe somebody suggests needing quotes around the printer name in
.paprc, but I didn't...

D.

---

From: "Morgan Reed" <[email-masked]>
Date: Tue, 30 May 2000 22:33:28 -0400

alright, I made some corrections in my print cap (the typos you saw were
actully a result of me transcribing from one machine to another)

I checked ownership and chowned whant needed to be chowned.  still no luck
on printing.

Part of my probelm is I don't really understand the error message I am
getting....

This implys that the print infor is being passed from the lpr to
lp@localhost, where it dies.  why is that?  what does the message mean?

Thanks everyone so far, getting closer (or at least I hope so)

-----Original Message-----
From: Lancaster, David Matthew [mailto:[email-masked]]
Sent: Tuesday, May 30, 2000 7:52 AM
To: Morgan Reed
Cc: [email-masked]; [email-masked]
Subject: Re: Need some help with printing on a LaserWriter IIg

D.

---

From: "Lancaster, David Matthew" <[email-masked]>
Date: Wed, 31 May 2000 08:47:52 -0300 (ADT)

> Thanks everyone so far, getting closer (or at least I hope so)

Quick search on google pointed out that Debian has some outstanding
problems with lprng, at least in some revisions (including potato, which I
belive has only just made it into 'frozen')

Check
http://www.de.debian.org/Lists-Archives/debian-user-9909/msg00100.html
and see if the solution applies to you and the versions you're running.

David Lancaster                       (506) 454-2167
  690 Gregg Ct.                       Upper Apartment
  Fredericton, NB  Canada             E3B 4H5
  [email-masked]       "Don't anthropomorphize computers, they hate that."

---

From: "Morgan Reed" <[email-masked]>
Date: Fri, 2 Jun 2000 00:25:31 -0400

David,

	You said you have your IIg hooked up via ethertalk to your linux box and
you have no external "zones" that you can see, could you tell me what your
.paprc looks like?

Morgan

-----Original Message-----
From: Lancaster, David Matthew [mailto:[email-masked]]
Sent: Tuesday, May 30, 2000 7:52 AM
To: Morgan Reed
Cc: [email-masked]; [email-masked]
Subject: Re: Need some help with printing on a LaserWriter IIg

D.

---

From: "Lancaster, David Matthew" <[email-masked]>
Date: Fri, 2 Jun 2000 08:25:11 -0300 (ADT)

---Contents or .paprc in /var/spool/lpd/laser---
LaserWriter IIg
------------------------------------------------
That's it. That one line all by itself.

---

From: "Morgan Reed" <[email-masked]>
Date: Wed, 7 Jun 2000 01:03:07 -0400

I need help.  still can't get the printer to work and am starting to get
frustrated.  I need to know if anyone can explain what is happening in the
following line:

My printcap is as follows, there is a space after the last line, and there
is nothing else in the printcap except the double ## text at the top:

lp:\
 	:of=/usr/lib/atalk/filters/ofpap:\
	:lp=/dev/null:\
 	:sd=var/spool/lpd/LaserWriterIIg:\
 	:pl#63:pw#85:\
 	:mx#0:\
 	:sh:\
	:sf

I have set up a directory in the lpd folder called LaserWriterIIg and the
filters are in the directory /usr/lib/atalk/filters/ and the ethernet name
of the printer is MMLab IIg.
I have a .paprc in the dir /var/spool/lpd/LaserwriterIIg and it reads:
MMLab IIg

I can print with pap -p "MMLab IIg" test1.ps, that works fine.  but I get
the lp@localhost error when I try to do lpr -P lp test1.ps

I need help in a big way!

Sincerely,

Morgan

---

From: andrew morgan <[email-masked]>
Date: Tue, 6 Jun 2000 23:15:24 -0700 (PDT)

> the lp@localhost error when I try to do lpr -P lp test1.ps

I don't know if this is the problem, but you are missing a leading slash
in your definition of the spool directory.  It should be
"sd=/var/spool/lpd/LaserWriterIIg:\".

If that isn't it, then maybe this note from the psf(8) manpage is
relevant:

Note that if the host in question spools to more than one AppleTalk
printer,  /dev/null should  not  be  used for the lp capability.  Instead,
a null device should be created with mknod for each printer, as has been
done above.

You can create a null device in your spool directory with the following
command:

mknod /var/spool/lpd/LaserWriterIIg/null c 1 3

You may need to fiddle with the permission bits on the null device (666
maybe?).

	Andy

---

From: "Lancaster, David Matthew" <[email-masked]>
Date: Wed, 7 Jun 2000 08:50:44 -0300 (ADT)

This really does sound like more of a lpd/lpr problem. I think I sent you
a link to a discussion on a few known problems with Debian's lpd that
causes "transfer to lp@localhost failed" messages, did you find anything
applicable there? Version lprng_3.5.2-1.2 is problematic, check what
version you have.

Another possiblity is the /etc/lpd.perms file (debian slink/potato+)
The bottom line may read DEFAULT REJECT and you can change this to DEFAULT
ACCEPT (may have security implications, but fix that later).

Um, verify that lpd is running: ps ax | grep lpd
Have you tried dumping both 1) a plain ASCII file 2) a PS file to lp?

It's also possible its having problems communicating with the lpd spool
daemon. Check that your loopback interface is working (ping 127.0.0.1,
check ifconfig, try telneting to 127.0.0.1 & 127.0.0.1 printer). 
Check your hosts.lpd entry, you might need your hostname in there.
Also check your hosts.deny for any entries that might affect this.

Suggest you may want to verity that lpd is working properly before
worrying about the netatalk portion. Any other printers to test with?
Also, try looking for some info from debian.com about this particular
problem.

(It just occured to me, I think you're running Debian, I seem to recall
that, but I'm not 100% sure...oh well...most of this might apply anyway.
;)

---

From: "Lancaster, David Matthew" <[email-masked]>
Date: Wed, 7 Jun 2000 08:53:41 -0300 (ADT)

> a null device should be created with mknod for each printer, as has been

Oops, forgot to mention that point...but if you're only using one printer,
it "shouldn't" be a problem (course, if I had a dollar for every time I
said that...)

> You may need to fiddle with the permission bits on the null device (666

Only a null of evil Darth?

D.

---

From: "Morgan Reed" <[email-masked]>
Date: Thu, 8 Jun 2000 01:34:06 -0400

Ok,
I checked my lpd.perms file and DEFAULT ACCEPT was and is the bottom line, I
ps ax | grep lpd and got what I think is the correct response:
1085	1 S	0.00 grep lpd
 161	? S	0.00 lpd MAIN

I made a /dev/null file.

still nothing.

Additionally though, I tried something;  I put in lpr -P blahblah test1.ps
where blahblah is a nonexistant printer with no record created anywhere, and
I get the same response except it now reads transfer to blahblah@localhost
failed.

In my pointy little head, this suggests that the printcap is not getting the
correct information to the program.  In essence, as far as lpr is concerned,
no printers at all exist.  This is all getting me a little crazy, especially
since I can print using pap.  If I couldn'tprint via pap I would have given
up and tried it with the serial plug.  But because I can print with pap
tells me it is more than likely an lpr problem; but that still doesn't get
me any closer to printing.

Oh, I did check and fix the preceeding / in front of var.  no change.

Anyone got any other grand ideas on getting lpr to work?  I will sacrifice a
chicken to the linux gods if I thought it would work.

---

From: Sak Wathanasin <[email-masked]>
Date: Thu, 8 Jun 2000 09:37:06 +0100

In reply to Morgan Reed's message of the 08/06/2000 at 01:34 -0400,

>chicken to the linux gods if I thought it would work.

My guess is that lpd can't write to the specified spool directory. 
Here's my /etc/printcap:

laser|lp|LaserWriter LW600 on AppleTalk:\
         :sd=/var/spool/lpd/laser:\
         :sh=true:\
         :lp=/dev/null:\
         :lf=/var/log/lpd-errs:pw#80:\
         :of=/usr/local/atalk/etc/filters/ofpap:\
         :if=/usr/local/atalk/etc/filters/ifpap:\
         :tf=/usr/local/atalk/etc/filters/tfpap:\
         :df=/usr/local/atalk/etc/filters/dfpap:

and here are the perms on my spool directory (sd=...):

# ls -la /var/spool/lpd/laser
drwxrwsr-x   2 lp       lp           1024 Jun  8 09:24 .
drwxrwxr-x   3 root     daemon       1024 Jan  6 22:41 ..
-rw-r--r--   1 lp       lp             33 Dec 27  1997 .paprc
-rw-rw----   1 lp       lp             84 Oct 11  1998 .railmag
-rw-r----x   1 lp       lp              4 Jun  8 09:24 .seq
-rw-rw----   1 bin      lp             90 Jun  8 09:24 cfA026fe.nan.co.uk
-rw-rw----   1 root     lp          11003 Jun  8 09:24 dfA026fe.nan.co.uk
-rw-rw-r--   1 lp       lp              6 Jun  8 09:24 errseEjocI
-rw-r--r--   1 lp       lp             25 Jun  8 09:24 lock
-rw-rw-r--   1 lp       lp             32 Jun  8 09:24 status
-rw-rw-rw-   1 lp       lp             26 Jun  8 09:02 stdin

Note the use of setgid to ensure that spool files are created in 
group lp no matter who creates them.

You can use the same trick for dirs that are to be mounted as 
netatalk volumes. Contrary to popular belief, mode 777 is neither 
necessary nor advisable.
-- 
Sak Wathanasin
Network Analysis Limited
178 Wainbody Ave South, Coventry CV3 6BX, UK

Internet: [email-masked]
Phone: (+44) 24 76 41 99 96        Mobile: (+44) 79 70 75 19 12 
Fax: (+44) 24 76 69 06 90

---

From: "Lancaster, David Matthew" <[email-masked]>
Date: Thu, 8 Jun 2000 08:31:54 -0300 (ADT)

Ok, sounds like you've narrowed it down a bit. 

Check if lpd is able to read your printcap file correctly.
Do a "lpc status", you should get something similar to:
lp:
        queuing is enabled
        printing is enabled
        no entries
        no daemon present

If not, lpd is unable to parse your printcap. I found printcap can be
picky...I had a problem which was either an extra space, tab, or CR
character at the end a printer def, and it wouldn't work till I deleted
it. If you want, I can email you a copy of my printcap, and you can check
if that's your problem.

Another thing I just noticed...in your ps ax | grep lpd, it shows the lpd
process with an argument "MAIN".  According to my RH6 man pages, lpd only
takes one argument, which is the port#...
What happens when you type:
a) telnet localhost printer
b) telnet localhost MAIN

And just to clarify, DID you try to update lprng???

---

From: andrew morgan <[email-masked]>
Date: Thu, 8 Jun 2000 07:19:49 -0700 (PDT)

I didn't realize you were using lprng...  You can get excellent help by
asking your question in the lprng mailing list.  Go to
http://www.astart.com/lprng/LPRng.html and at the bottom of the page is
instructions on how to join the mailing list.

Also, have you ran "checkpc -f"?  This should fix up all the permissions
on your spool directory...

	Andy

---

From: Patrik Schindler <[email-masked]>
Date: Thu, 8 Jun 2000 18:23:55 +0200

> 	job 'cfA679LinuxBox2.thereedfamily.org' transfer to lp@localhost failed

Did you put "localhost" in your /etc/hosts.lpd?

:wq! PoC

---

From: "Morgan Reed" <[email-masked]>
Date: Thu, 15 Jun 2000 21:34:17 -0400

Well David, I am back with the printer questions that would not quit!

I had to take a hiatus b/c my lovely IIg printer decided to kill the
internal fan that keeps it cool, so I had to find an old HP LaserJet III to
rob the AC unit from.  The surgery went fine, and I am back up and
printing....but still only from pap.

Following your directions, I did checkpc -f  which fixed a few on the
niggling permission errors.  It did, however, give me an error on my
/dev/null file (I just created an empty document with ae named null.
additionally, it says "cannot open log" but then again, I haven't done any
printing with the spooler, so it is no surprise I have nothing in log.

I tied to print with lpr -P lp test1.ps  and now get a "connection refused"
error.
Specifically:
LinuxBox2:/#lpr -P lp test1.ps
connection to 'localhost' failed - Connection refused
job ' cfA262LinuxBox2.thereedfamily.org' transfer to lp@localhost failed

SO then I tried to telnet to 127.0.0.1 printer ... and got a similar
connection refused error. Speifcally:

LinuxBox2:/# telnet 127.0.0.1 printer
telnet: Unable to connect to remote host: Connection refused

I was able to ping 127.0.0.1,and telnet 127.0.0.1 with no problem so
localhost is active in some way... I feel we are really on the cusp of a
breakthough, you have any other good ideas?

 I realize this problem is outside the scope of the normal netatalk
discussion, but, you have been through this problem at every step, so you
may be the best, and quickest resource.

Thanks again

Morgan

---

From: "David Lancaster" <[email-masked]>
Date: Fri, 16 Jun 2000 18:29:54 -0300

> printing with the spooler, so it is no surprise I have nothing in log.

Well, /dev/null shouldn't be just a normal file....it may end up working for
you, but I believe that there is a correct way to create one (possibly with
mknod or something, I'm not sure as it's outside my current area of
expertise).  The log file thing is troubling, perhaps you should check the
permissions on the log file.

> breakthough, you have any other good ideas?

Well, that sounds like your problem.  Somewhere, there is a setting that is
either specifically denying you access, or you are not implicitly getting
access.
Try each one of these seperatly, and see if any of them solve your problem.

1.  Try putting your hostname in /etc/hosts.lpd
2.  Try putting your ip address in /etc/hosts.lpd
3.  Try putting 127.0.0.1 in /etc/hosts.lpd

In theory, one of these (hopefully the first one) will ensure that lpd will
allow you to connect.
If none of these work, I'd check to see if you have any active firewall
rules that would be preventing connections on the printer port.

Well, that's all I can think of off the top of my head so far.  Lemme know
if anything works, and if not...well, guess we'll have to try something
else.

D.

---

From: andrew morgan <[email-masked]>
Date: Fri, 16 Jun 2000 15:12:28 -0700 (PDT)

> permissions on the log file.

You can make null device with the following command:

mknod -m 666 filename c 1 3

Replace filename with whatever directory/filename you want to call it.
This creates a character device (c) of major type 1 and minor type 3 with
permissions 666.

	Andy

---

From: "Morgan Reed" <[email-masked]>
Date: Sat, 17 Jun 2000 23:53:20 -0400

This is what I get now if I do a checkpc

LinuxBox2:/etc# checkpc
 LPRng version LPRng-3.5.1

Checking permission file '/etc/lpd.perms:/usr/etc/lpd.perms'
 Freeing Perms
 Done Perms
 LPD lockfile '/var/spool/lpd/lpd.lock.LinuxBox2.printer'
  Checking directory: '/var/spool/lpd'
   checking file '/var/spool/lpd/lpd.lock.LinuxBox2.printer'
 Truncating LPD log file '/var/spool/lpd/lpd.log.LinuxBox2'
 Checking /var/spool/lpd/lpd.log.LinuxBox2 file
'/var/spool/lpd/lpd.log.LinuxBox2'
checkpc: Warning - cannot open '/var/spool/lpd/lpd.log.LinuxBox2'
 lp: Checking printer 'lp'
 lp:  Checking directory: '/var/spool/lpd/LaserWriterIIg'
 lp:   checking file '/var/spool/lpd/LaserWriterIIg/control.lp'
 lp:   checking file '/var/spool/lpd/LaserWriterIIg/status.lp'
 lp:   checking file '/var/spool/lpd/LaserWriterIIg/status'
 lp:   checking file '/var/spool/lpd/LaserWriterIIg/log'
 lp:   checking file '/var/spool/lpd/LaserWriterIIg/acct'
checkpc: Warning - '/var/spool/lpd/LaserWriterIIg/null' not a regular file -
unu
sual
 lp: Checking log file '/var/spool/lpd/LaserWriterIIg/log'
 lp:    'log' file 16062 bytes long: no truncation
 lp: Checking accounting file '/var/spool/lpd/LaserWriterIIg/acct'
 lp:    'accounting' file 1431 bytes long: no truncation
 lp: Checking filter status file '/var/spool/lpd/LaserWriterIIg/status'
 lp:    'filter status' file 26 bytes long: no truncation

-----Original Message-----
From: David Lancaster [mailto:[email-masked]]
Sent: Friday, June 16, 2000 5:30 PM
To: Morgan Reed
Cc: [email-masked]
Subject: Re: Need some help with printing on a LaserWriter IIg

D.