Re: netatalk & afpfs


Subject: Re: netatalk & afpfs
From: philippe tapon (philippe@ufoh.com)
Date: Tue Nov 28 2000 - 13:06:32 MST


Terry Welch wrote:
>
> I have a problem related to Netatalk and that is to have my Linux box see the
> Mac. I understand one need to install an afpfs module. Can anyone help ?
> Where to get a working copy and the steps to install. Or is there an easier
> way to get my Linux box print to a networked HP Laswerwriter 4500. It has been
> very frustrating!
>
> Terry Welch

Howdy

If you've got the netatalk that came with CS 1.2.1, you've got, I think,
what you need to print to a networked HP.
        I'm not totally sure about the details will be in your case, but here's
what I think you have to do (no guarantees) to print to a networked HP.
You should visit http://www.linux-printing.org. Grant Taylor is a linux
printing god. Hail. Now, some steps. . . .

        1. Get netatalk to work. It seems that, in addition to all the tips
in the HOW-TO, some of us have to execute a root# /sbin/insmod
appletalk, but you may not have to.
        2. Once netatalk worked I found I could execute bash$ nbplkup and see
what my linux box was seeing on the AppleTalk network. If you can't see
your LaserWriter on the chart that npblkup returns, you may not have
classic AppleTalk (atalkd) up and running. npblkup returns the
addresses of the network thingies.
        3. You should also be able execute bash$ aecho "My Laserwriter" . "My
Laserwriter" is the name of your LaserWriter as listed by nbplkup.
aecho should send out pings and return them; if they're not coming back
100%, there's a weirdness with your network which you may have to
correct. (I got returns of negative 100%, because I was using LocalTalk
Bridge, an old but very useful piece of free Apple software that can
splice a LocalTalk printer onto an ethernet bridge. I was gaining
packets! But ordinarily you shouldn't lose packets.)
        4. You then have to define the printer. You can find more complete
directions on the web, but the outline is this----
                a. Define /etc/printcap. You can try running root# printtool which
summons a point-and-click interface which sometimes even produces
working printcaps! The default printer is named lp, and if you only
have one printer, you must call it lp. /etc/printcap (PRINTer
CAPability) can define many printers, and for each printer can define
                        i. a spool directory, sd=, which can be /var/spool/lpd/lp
                        ii. a device (which may be a formality, like /dev/hole_in_the_ground)
                        iii. an input filter (which you may need to convert stuff to
postscript)
                        iv. a log file
You must make sure that there's a not a single space character anywhere
around your print entry in /etc/printcap or you will get phantom
printers turning up when you . . .
                a'. run bash$ /usr/sbin/lpc This command should call up a >
prompt. If you type >status you should get the info on the printer
you're intending to print to.
                b. Define the spool folder, the device if needed, the input filter if
needed, the log file if you want it. The HOWTOs will go into this more
in detail; I can't claim expertise. . . . Essentially /etc/printcap
defines the printer and defines where its directories and files live;
you then have to create those directories. printtool (sometimes
succesfully) does all this automatically.
                c. Define .paprc, .seq, lock, and status, four files that control your
printer. Again, consult the HOWTOs; if printtool didn't do everything
for you, the command root# touch status (for example) is enough. The
file .paprc is crucial for a networked printer that you're going to get
through to across netatalk. .paprc contains the name and appletalk
address of the printer you want, and I think it always lives in the
printer's spool directory (that's how the daemons find it).

(It's easiest for me to understand the big picture (which I'm sure has
inaccuracies, but whatever). When you ask an application to print, it
executes lpr, which then rouses the sleeping lpd daemon to life. lpd
takes the file name (or assumes standard input) and printer name (or
assumes the default printer lp) from lpr. lpd checked /etc/printcap
when it was first invoked, and so knows which spool directory to slip
the print job into; somehow it sweeps the spool directory as well (?
this is the part I'm fuzzy on). Along the way the job gets processed
through an input filter. The lock file gets locked and the status files
gets an entry and .paprc is checked: .paprc contains the address of the
printer the job will be sent to. The filtered job is sent to the
AppleTalk-networked-printer, something else gets sent to the device
(i.e. outer space, /dev/null, whatever) the lock file is unlocked, the
status file is updated, and the lpd daemon goes back to sleep.)

.paprc should contain the address, and some people report problems if
there isn't a carriage-return after the entry. Unlike /etc/printcap,
.paprc doesn't mind extra white spaces so could put in a few
carriage-returns if you are so inclined.
        The command bash$ papstatus should return something which fills you
with confidence, like "lp is ready." There is a possibility that at
first you will get "NBP lookup failed." Sometimes papstatus only works
if you run it in the directory where .paprc actually is. There is also
the question of whether or not "quotes" should go around your printer's
name in .paprc. Different people report different things. i changed my
printer name from "beige endosperm" to "endosperm" in an effort to
simplify matters.

        5. Whew! Having defined the printer, you have to make sure the lpd
daemon is evoked. the command bash$ ps xa | grep lpd should show lpd
running. You can put an /usr/sbin/lpd command in /etc/rc.d/rc.local if
lpd isn't haunting the corridors of your computer at startup. It is a
good idea to check the permissions of the various directories; the
HOWTOs will explain this further.

Stuff will probably have to be fine-tuned at this point but the basics
should be there, and the print job should get to the HP. To use a rugby
metaphor, it's like passing a ball down a line of backs; each
guy has to stand where the others expect him to be. Werner Eugster has
written very
wonderfully on appletalk and printing:
    
http://www.giub.unibe.ch/~eugster/appleprint.html
http://www.mailgate.org/linux/linux.appletalk/msg00090.html

good luck

philippe



This archive was generated by hypermail 2a24 : Mon Nov 27 2000 - 13:18:09 MST