Netatalk Tutorial

Ladies and Gentlemen, a tutorial on how to get Netatalk and Avahi running on your MyBook.

The MyBook unit used for this was a 1TB single disc version.

None of this would have been possible without Clifford Meece and his efforts in creating the Netatalk and Avahi builds (and his scripts).

Clifford website is

The Tutorial:

NOTE: There are now Optware versions of avahi and netatalk available! This means you do not have to install libc-dev, however you will still need to create startup scripts.

Get Clifford's packages: See bottom of this screen under 'files' (you must be logged in to see this option).

Files: avahi, S90optware, netatalk_package.ipk, avahi_package.ipk

Put them in /shares/internal/Public

Do the following in your ssh shell.

ipkg install libc-dev
mv /shares/internal/Public/avahi /opt/etc/init.d
chmod u+x /opt/etc/init.d/avahi
ln -s /opt/etc/init.d/avahi /opt/etc/init.d/S99avahi
mv /shares/internal/Public/S90optware /etc/init.d
chmod u+x /etc/init.d/S90optware

S90optware is a script that will run on startup (make sure it is executable with chmod u+x). It will run from /etc/init.d and go into /opt/etc/init.d and run any startup scripts there. It makes optware easier to deal with.

ipkg install /shares/internal/Public/avahi_package.ipk
ipkg install /shares/internal/Public/netatalk_package.ipk

Have a look and make sure 'opt/lib' is in /etc/

Add user 'avahi' to /etc/password - remember to give a unique user id (mine is 107)
Add group 'avahi' to /etc/group - copy the format of an existing line

Setting up netatalk

cd /opt/etc/netatalk/
nano netatalk.conf

Make these changes:-

# Set which daemons to run (papd is dependent upon atalkd):

Save it.

Optional (The default is to share home directories. I had already created a user and password in the WD web interface. I then modified that user's home directory in /etc/password. I made /shares/internal the home for my user, so when I 'connect as' from a mac, I can log in as my user and it goes straight to /shares/internal).

nano AppleVolumes.default (here you can specify exact directories and users. I didn't bother, but you can find info on google about this). Here is a great tutorial about setting up time machine to a remote disc and it covers in detail the options for netatalk shares.

Setting up avahi to broadcast your box

cd /opt/etc/avahi/services
nano afpd.service

paste in this:-

<?xml version="1.0" standalone='no'?><!--*-nxml-*--> 
<!DOCTYPE service-group SYSTEM "avahi-service.dtd"> 
<name replace-wildcards="yes">%h</name> 

Save it.

This will get avahi to advertise your MyBook like it is an X-serve.

You'll see it in the Leopard side bar…..

But not until we quickly create a script in /etc/init.d in order to fire off afpd (the part of netatalk we are using) on boot up.

nano /opt/etc/init.d/S98afpd

paste in:-

# Start afp daemon 
start() { 
        echo "Starting afpd" 
        /opt/sbin/afpd -D 

stop() { 
        echo "Stopping afpd" 
        #killall afpd > /dev/null 2>&1 
        /opt/sbin/afpd -k 
restart() { 

case "$1" in 
                echo $"Usage: $0 {start|stop|restart}" 
                exit 1 

exit $?

Save it.

Make it executable

chmod u+x /opt/etc/init.d/S98afpd

And finally…

nano /opt/etc/avahi-daemon.conf

Change the 'host-name' to something other than 'MyBookWorld'. If you don't and you are using Samba on your unit, things will get buggered up because the mDNS responder that advertises the Samba shares is trying to use 'MyBookWorld.local' by default, and so is avahi. Avahi wins and Smaba gets shafted.

That's it. Reboot and pray.

Works great here. Thanks again to Clifford.


Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License