Subject: Printing problems (long)

From: John L Grantham <[email-masked]>
Date: Thu, 25 Jan 2001 23:50:48 +0100

Hi all,

I'm having a great deal of trouble trying to print using a Personal 
LaserWriter NTR from Apple, connected via serial cable to /dev/ttyS1. 
I am using a PowerMac G3 MT/266 with LinuxPPC 2000 Q4; the kernel 
does have AppleTalk support built-in. Netatalk works fine on the file 
server end.

First I used stty to throttle the port:

stty 9600 raw -echo -crtscts ixon ixoff cstopb < /dev/ttyS1

For reference, here are the settings Apple says for the printer:
http://til.info.apple.com/tilarchive.nsf/artnum/n15070
I have the printer set on 5 (9600 baud serial, XON/XOFF).

If I type in "cat test.ps > /dev/ttyS1", it prints fine. However, if 
I try to print with netatalk or lpd, it doesn't.

Here is my /etc/printcap:

lp|SerialShakespeare:\
         :sd=/var/spool/lpd/lp:\
         :mx#0:sh:rw:sf:\
         :lp=/dev/ttyS1:\
         :ms=-parity,onlcr,ixon,ixoff:\
         :fc#0000374:fs#0000003:xc#0:xs#0040040:\
         :br#9600:
         :if=/usr/sbin/psf:\
         :lf=/var/spool/lpd/lp/lpd-errs:\
         :of=/usr/sbin/psf:

lp0|AppleTalkShakespeare:\
         :sd=/var/spool/lpd/lp0:\
         :mx#0:sh:rw:sf:\
         :lp=/dev/null:\
         :if=/usr/lib/atalk/filters/ifpap:\
         :of=/usr/lib/atalk/filters/ofpap:

Here are the permissions on the relevant files:

[root@hobbithole lp0]# ls -al /dev/ttyS* /dev/lp*
lrwxrwxrwx    1 root     root           10 Jan 21 18:26 /dev/lp -> /dev/ttyS1
crw-rw----    1 root     daemon     6,   0 May  5  1998 /dev/lp0
crw-rw----    1 root     daemon     6,   1 May  5  1998 /dev/lp1
crw-rw----    1 root     daemon     6,   2 May  5  1998 /dev/lp2
crw-rw-rw-    1 root     tty        4,  64 May  5  1998 /dev/ttyS0
crw-rw-rw-    1 root     tty        4,  65 Jan 25 21:35 /dev/ttyS1
crw-rw-rw-    1 root     tty        4,  66 May  5  1998 /dev/ttyS2
crw-rw-rw-    1 root     tty        4,  67 May  5  1998 /dev/ttyS3

[root@hobbithole lpd]# ls -al /var/spool/lpd
total 28
drwxrwxr-x    4 root     daemon       4096 Jan 25 22:31 .
drwxr-xr-x   10 root     root         4096 Jan 23 22:29 ..
-rw-rw-r--    1 root     daemon          5 Jan 25 22:40 lock
drwxrwxrwx    2 root     daemon       4096 Jan 25 21:35 lp
drwxrwxr-x    2 root     daemon       4096 Jan 25 22:41 lp5
-rw-rw-r--    1 root     daemon          5 Jan 25 22:40 lpd.lock

[root@hobbithole lpd]# ll /usr/sbin/ps*
-rwxr-sr-x    1 root     daemon       4568 Dec 21  1999 /usr/sbin/psa
-rwxr-sr-x    1 root     daemon      11232 Dec 21  1999 /usr/sbin/psf

Finally, lpc status says:

[root@hobbithole lpd]# lpc status
lp:
         queuing is enabled
         printing is enabled
         no entries
         no daemon present
         :
         queuing is enabled
         printing is enabled
         no entries
         no daemon present
lp5:
         queuing is enabled
         printing is enabled
         no entries
         no daemon present

One strange thing is that, when I try to print (either with netatalk 
or locally with lpr), something resets ttyS1 to 110 baud.

When I try printing with lpr, it seems the file is sent, but it just 
sits in the queue forever and then finally times out.

If I try printing via netatalk over the network or pap locally, the 
job gets queued repeatedly (the queue keeps filling up) until I kill 
the queue with lprm -. In the meantime, I also get the messages:

Didn't get initial page count!
status: Permission denied
status: Permission denied
Unknown
Unknown

repeated over and over until I kill the queue. Finally, in 
/var/log/messages, I get the following when trying to print via 
netatalk:

Jan 25 22:44:50 localhost papd[7833]: lp_print queued
Jan 25 22:44:50 localhost papd[5028]: child 7833 done
Jan 25 22:44:50 localhost ifpap[7830]: 7832 done
Jan 25 22:44:50 localhost ifpap[7830]: wait3: No child processes
Jan 25 22:44:50 localhost ofpap[7827]: restarting
Jan 25 22:44:50 localhost lpd[7369]: restarting lp5
Jan 25 22:44:50 localhost ofpap[7827]: done
Jan 25 22:44:50 localhost ofpap[7835]: starting for ?
Jan 25 22:44:50 localhost ofpap[7835]: sending to pap[7836]
Jan 25 22:44:50 localhost papd[5028]: child 7837 for "Shakespeare" 
from 65280.107
Jan 25 22:44:50 localhost ofpap[7835]: straight text
Jan 25 22:44:50 localhost papd[5028]: child 7837 done
Jan 25 22:44:50 localhost ofpap[7835]: 7836 done
Jan 25 22:44:50 localhost ofpap[7835]: pausing
Jan 25 22:44:50 localhost ifpap[7838]: starting for daemon
Jan 25 22:44:50 localhost ifpap[7838]: accounting with psa[7839]
Jan 25 22:44:50 localhost ifpap[7838]: sending to pap[7840]
Jan 25 22:44:50 localhost ifpap[7838]: PostScript
Jan 25 22:44:50 localhost papd[5028]: child 7841 for "Shakespeare" 
from 65280.107
Jan 25 22:44:50 localhost papd[7841]: lp_print queued
Jan 25 22:44:50 localhost ifpap[7838]: 7840 done
Jan 25 22:44:50 localhost ifpap[7838]: 7839 died with 2
Jan 25 22:44:50 localhost lpd[7369]: lp5: job could not be printed 
(cfA830hobbithole)
Jan 25 22:44:50 localhost ofpap[7835]: restarting
Jan 25 22:44:50 localhost papd[5028]: child 7841 done
Jan 25 22:44:50 localhost ofpap[7835]: sending to pap[7843]
Jan 25 22:44:50 localhost ofpap[7835]: straight text
Jan 25 22:44:50 localhost papd[5028]: child 7844 for "Shakespeare" 
from 65280.107
Jan 25 22:44:50 localhost ofpap[7835]: 7843 done
Jan 25 22:44:50 localhost ofpap[7835]: pausing
Jan 25 22:44:50 localhost ifpap[7845]: starting for daemon
Jan 25 22:44:50 localhost ifpap[7845]: accounting with psa[7846]
Jan 25 22:44:50 localhost papd[5028]: child 7844 done
Jan 25 22:44:50 localhost ifpap[7845]: sending to pap[7847]
Jan 25 22:44:50 localhost ifpap[7845]: PostScript
Jan 25 22:44:50 localhost papd[5028]: child 7848 for "Shakespeare" 
from 65280.107

This also gets repeated over and over again until the queue is killed.

Can someone help me out?

Thanks,

John
-- 

John Grantham	| Dipl.-Designer (FH)
		| Homepage       http://design.macnews.de/
		| Linux for PPC  http://www.maclinux.de/
Web Designer	| AGD Member     http://www.agd.de/