Basic MkLinux netatalk Setup


Document Change History (check here to see what's different if you've visited this page before)

For notes in German, see http://linux.macnews.de/.

This document describes some of the steps I took to perform basic netatalk setup after installing the MkLinux netatalk distribution.

There are certain system requirements you must satisfy to be able to run netatalk on MkLinux:

For the MkLinux distribution, check ftp://ftp.mklinux.apple.com/pub/FullRelease/ For the netatalk distribution, check ftp://ftp.mklinux.apple.com/pub/FullRelease/Archives/rpm.bin/ In both cases, be sure to read all the README files. A big "thank you" to Michel Pollet, who did the work necessary to make netatalk work under MkLinux.

(Note: This document applies to netatalk 1.3.3. There is a netatalk 1.4b1 distribution out now, but although it can be compiled, it doesn't seem to run properly under MkLinux yet. If you want to take a crack at it, see my notes on getting it built.)

Getting Information

The MkLinux netatalk README points you to http://www.umich.edu/~rsug/netatalk/ for setup information. That's a reasonable starting point, but it's not obvious where to look for what you need. After much poking around, I found the following documents to be useful sources of information:

Note that most of the information in these pages is geared toward PC Linux users, so some of the pathnames aren't correct for MkLinux.

Another source of information is the manual pages. These are located under /usr/local/talk/man. Again, pathnames, etc., are sometimes inappropriate for MkLinux.

Nevertheless, by reading stuff on the Web, together with the manual pages, I was able to piece together enough understanding to get netatalk file and print services running on a small network.

You'll need to become root to do most of the steps below.

Basic Setup

In order to be able to execute netatalk programs and look at netatalk manual pages more easily, I set my command search path in one of my shell's startup files. You might want to do something similar. For csh-derived shells, the command is:

    setenv PATH $PATH:/usr/local/atalk/bin:/usr/local/atalk/sbin

For sh-derived shells, the command is:

    PATH=$PATH:/usr/local/atalk/bin:/usr/local/atalk/sbin
    export PATH

The netatalk manual pages are located under /usr/local/atalk/man. Because the netatalk man command is smart enough to look under /some/path/man if your PATH setting includes /some/path/bin, adding /usr/local/atalk/bin to your PATH as shown above is sufficient to allow man to find the netatalk manual pages.

The netatalk configuration file is /usr/local/atalk/etc/atalkd.conf (not /etc/atalkd.conf as the atalkd manual page states). The only line I had to put in the configuration file was this:

    eth0 -phase 2

My test network is isolated and thus has no routers. If you're running on a network with routers, you might want to specify some of the other options mentioned in the atalkd manual page.

When netatalk starts up, it rewrites the configuration file if it can to put in network and address values. This will occur if the file is writable (e.b., mode 664), but not if the file is read-only (e.g., mode 444).

In addition to setting up the configuration file, you should also add the following lines to your /etc/services file. They define the names and numbers of standard AppleTalk protocols:

    rtmp   1/ddp    # Routing Table Maintenance Protocol
    nbp    2/ddp    # Name Binding Protocol
    echo   4/ddp    # AppleTalk Echo Protocol
    zip    6/ddp    # Zone Information Protocol

In order to allow my MkLinux file systems to be exported to MacOS clients, I created an /etc/AppleVolumes.system file with these contents:

    /    grey-root
    /usr grey-usr
My MkLinux host name is grey; the /etc/AppleVolumes.system file shown above causes the / (root) and /usr file systems to be advertised on the AppleTalk network as grey-root and grey-usr.

Exported volumes can also be specified using the /etc/AppleVolumes.default file. The difference between the two files is that volumes listed in /etc/AppleVolumes.system are always offered, and the volumes listed in /etc/AppleVolumes.default are offered to users who have no AppleVolumes or .AppleVolumes file in their home directory.

The AppleVolumes files can be used to specify that filenames with particular extensions have a given file type and creator. This will make them show up on MacOS clients with non-generic icons. For example, if you want .txt files to show up with BBEdit document icons, you could use this:

    /    grey-root
    /usr grey-usr
    .txt TEXT R*ch

An important function of the AppleVolumes files is that they control carriage return-linefeed (CRLF) mapping. The default file type for netatalk is TEXT and it converts line ending characters when copying text files between MacOS and UNIX so that they are appropriate for each system (CR for MacOS, LF for UNIX). This is a problem for files that are really binary files (e.g., compressed files or tar archives) because CRLF mapping results in corrupted files. You can use the AppleVolumes files to suppress CRLF mapping. For instance, if I put the following in AppleVolumes.system, no mapping would occur:

    /    grey-root
    /usr grey-usr
    .    BINA UNIX
The "." extension is the default extension, used if no other extension applies to a given file. The specification above makes the default file type BINA so that CRLF mapping does not occur.

An AppleVolumes.system file like the following can be used to allow CRLF mapping only for specific extensions:

    /     grey-root
    /usr  grey-usr
    .     BINA UNIX
    .txt  TEXT R*ch
    .html TEXT R*ch

This way, CRLF mapping is allowed only for files we're pretty sure are text files. The result is that it's pretty unlikely a binary file will have mapping performed on it and corrupt its contents.

Note: Corruption may still occur if you copy a file that already has Macintosh type information of TEXT associated with it, regardless of what its extension is. For instance, if a file on a MacOS machine has an extension of .gz but type information of TEXT, then copying the file to a MkLinux volume will corrupt it. To avoid this problem, use a utility such as Snitch to change the file type to something else (e.g., ????) before copying it.

You can recompile netatalk to turn off CRLF mapping completely if you want to make sure it never occurs (this is what I do):

Setting up the AppleVolumes file causes netatalk to offer your file systems on your AppleTalk network. However, if connections from MacOS clients are refused, check /var/log/messages for error messages such as the one below:

  Sep 52 10:50:55 MkLinux afpd[475] illegal shell /bin/tcsh for dubois

Such a message means you need to list the full pathname of the shell in question in /etc/shells. If /etc/shells already exists, add the shell pathname to it. If it doesn't exist, create it and list the shell's pathname in it, as well as the full pathnames of any other login shells used on your system. (If you create /etc/shells, but only list your own shell in it, then users who use other shells will not be able to connect!)

Here is an example of what /etc/shells might look like:

    /bin/sh
    /bin/csh
    /bin/bash
    /bin/tcsh
    /bin/zsh

The netatalk startup script is /etc/rc.d/init.d/atalk, with symlinks to it in various other directories under /etc/rc.d. The only change I made to the startup script was to comment out the timelord lines, since timelord isn't included in the MkLinux netatalk distribution. (If you want timelord, it's available at ftp://terminator.rs.itd.umich.edu/unix/netatalk/.)

netatalk can be started manually with the following command (which takes a while to complete; be patient):

    # /etc/rc.d/init.d/atalk start

However, you'd likely do this only if you had installed the netatalk stuff after booting. Once netatalk is installed, the script runs automatically at boot time.

While you're still fooling around with netatalk trying to get it to run, at some point you'll probably want to shut it down and restart it. Unfortunately, it doesn't seem that you can do so with these commands:

    # /etc/rc.d/init.d/atalk stop
    # /etc/rc.d/init.d/atalk start

Starting back up fails due to inability to register NBP names. I don't know why this is, but it seems to be necessary to reboot MkLinux for netatalk to be able to start up properly. Apparently this is a problem under some versions of PC Linux as well.

Change History

03 July 1997

24 March 1997

14 December 1996

10 October 1996

1 October 1996

17 July 1996

6 July 1996

4 July 1996

2 July 1996

27 June 1996


Go to main MkLinux page
Document written by: Paul DuBois, paul@snake.net
Last updated: July 3, 1999