Netatalk v3.0 is a free, open-source implementation of the Apple Filing Protocol (AFP). It allows Unix-like operating systems to serve as file servers for Macintosh computers.
The older version of netatalk, v2.2.3, is distributed as netatalk-ddp and supports the Apple Macintosh network protocols, including AppleTalk (ATalk), Apple Filing Protocol (AFP), and Printer Access Protocol (PAP).
Use either the netatalk or netatalk-ddp packages available in AUR, which have initscripts tailored for ArchLinux.
With the deprecation of DDP (ATalk, PAP, timelord, and a2boot were removed in v3.0), netatalk has been divided into netatalk and netatalk-ddp. DDP is only necessary to support Mac OS <= 9, but OS X <= 10.3 will also benefit from the integration of SLP since it does not fully support Bonjour/Zeroconf. DDP would network older Macs which ran on AppleTalk instead of TCP/IP, and timelord and a2boot were for time-synchronization and Apple II booting. PAP may still be necessary for users with LaserWriter printers without TCP/IP support.
A build of the netatalk AUR package will only build the "modern" features cnid_metad and afpd, with Bonjour/Zeroconf support only.
To build the full complement of features with SLP support, build netatalk-ddp instead.
Install your finished package with pacman as usual, and remember to add "netatalk" to the daemons list in
Besides the configuration files that are installed (and checked during upgrade), netatalk may generate two files
/opt/netatalk/afp_signature.conf which holds the system UUID, and
/opt/netatalk/afp_voluuid.conf which holds volume UUIDs for TimeMachine. These files may remain after package removal and should be kept in most cases to disambiguate the services broadcast over the local network.
To emulate the init functionality of the systems fully-supported by netatalk, one initscript "netatalk" is responsible for starting and stopping the individual daemons. The script checks for the binaries available on the system, and starts them in a specific order, skipping those that are already running. The stop process occurs in reverse. To prevent ambiguity, only "netatalk" registers as a daemon with the system, but is silent, it doesn't echo any messages. The individual initscripts echo to the terminal, but don't register as daemons to prevent confusion.
The individual scripts are provided for users who may want to manage the daemons at runtime or add specific arguments, but don't worry, they will obey the necessary dependencies for proper operation. If a daemon is required by others, it won't stop until its children aren't running; if a daemon has dependencies it won't start until these are met.
Netatalk v3.0 now uses a single configuration file,
/etc/afp.conf. Installing v3 will move any old config files (
/etc/netatalk/AppleVolumes.default) out of the way. Global options and volume definitions will need to be added to
man afp.conf for help, but here is an example:
[Global] hosts allow = 192.168.1.0/16 [TimeMachine] path = /srv/share/timemachine valid users = joe time machine = yes [media] path = /srv/share/media valid users = joe sam
In addition, the daemons init scripts have been consolidated with this version. If you have
cnid, etc in you
DAEMONS list, remove then. Just
netatalk should appear.
If you have issues with
CNID, try rebuilding the databases. I had to remove the
.AppleDB files and run
dbd. This has the benefit of moving the
.AppleDB files into
/etc/netatalk/CNID rather than the root of the volume.
# Save the old .AppleDB files tar -cvzf /path/to/your/volume/.AppleDB rm -rf /path/to/your/volume/.AppleDB # Rebuild dbd -r /path/to/your/volume # Wait... on a large share it can take hours
One note: avoid symbolic links the volume paths. This caused me significant headaches. Also, I was able to eliminate the
cnidscheme configuration options that were previously in my v2 configuration files. The (new) defaults worked well.
Edit the afpd configuration file (
/etc/netatalk/afpd.conf), and add a line similar to
- -mimicmodel TimeCapsule6,106 -setuplog "default log_warn /var/log/afpd.log"
This tells netatalk to use the system's hostname, mimic a TimeCapsule, and log warnings and errors to file.
Edit the volumes configuration file
/etc/netatalk/AppleVolumes.default, and append the following to add a TimeMachine-like share
<path_to_share> <sharename> allow:<username> options:usedots,upriv,tm
volsizelimit:<limit_in_whole_mebibytes>argument can be useful here to limit the total space reported to TimeMachine.
- If you wish to turn off "home" shares, change the
If you use the iptables package for firewall services, consider adding the following: (replace
-A as necessary)
iptables -I INPUT -p udp --dport mdns -d 22.214.171.124 -j ACCEPT iptables -I OUTPUT -p udp --dport mdns -d 126.96.36.199 -j ACCEPT
iptables -I INPUT -p tcp --dport afpovertcp -j ACCEPT
iptables -I INPUT -p tcp --dport slp -j ACCEPT iptables -I OUTPUT -p tcp --dport slp -j ACCEPT iptables -I INPUT -p udp --dport slp -j ACCEPT iptables -I OUTPUT -p udp --dport slp -j ACCEPT
iptables -I INPUT -p tcp -m multiport --dport at-rtmp,at-nbp,at-echo,at-zis -j ACCEPT iptables -I OUTPUT -p tcp -m multiport --dport at-rtmp,at-nbp,at-echo,at-zis -j ACCEPT
Bonjour/Zeroconf is now a requirement of netatalk and is compiled by default. No configuration is necessary, netatalk will register its own services using the dbus link. Make sure you set
-mimicmodel to the desired string (see
/System/Library/CoreServices/CoreTypes.bundle/Contents/Info.plist on a Mac for a full list).