Monday, September 10, 2012

Linux Mint Debian Edition with Netatalk 3.0.1 for Mountain Lion 10.8 Support

I needed to share files with the macs i have in my house and i have a Brother DCP-7060D which has a scanner. It scans the files to the computer however i would still need to access it right? So i decided to set-up AFP on it. I installed the default netatalk 2.2.1 that was on the repository but then I decided to upgrade to netatalk 3.0.1 instead since a more updated release usually means more fixes and we all know of the problems with Lion and older netatalk versions. So if you're interested in using netatalk 3.0 then here's a short tutorial on how to compile it.

We'll need some of the libraries and header files to compile netatalk 3.0.1 Type this in a terminal.
sudo apt-get install libssl-dev libdb-dev libgcrypt-dev libcrack2-dev libavahi-client-dev libldap2-dev libacl1-dev libwrap0-dev checkinstall build-essential

So now the libraries are installed we need to get netatalk 3.0.1 sources.
cd ~
wget http://sourceforge.net/projects/netatalk/files/netatalk/3.0.1/netatalk-3.0.1.tar.gz
tar xvzf netatalk-3.0.1.tar.gz
cd netatalk-3.0.1

Now you need to configure the source files first
./configure --enable-debian --enable-zeroconf --with-cracklib --with-acls --with-ldap --enable-tcp-wrappers --with-init-style=debian

That should end properly with no errors stating what is supported whatsoever and now we compile it.
make

Once that is done we run checkinstall so we can properly remove it if needed.
sudo checkinstall --pkgname=netatalk --pkgversion="$(date +%Y%m%d%H%M)" --backup=no --deldoc=yes --default --fstrans=no

After that is done, netatalk should be properly installed.

All the configuration is done in one file now which is really awesome. The file is afp.conf and it's located at /usr/local/etc/afp.conf. We'll edit the configuration file and add in some stuff.
sudo nano /usr/local/etc/afp.conf

This is my personal configuration file and you can modify it as necessary.
Here's more info about how to modify afp.conf http://netatalk.sourceforge.net/3.0/htmldocs/afp.conf.5.html

afp.conf


So once you have your afp.conf configured you'll need to restart netatalk.
We do this with this command
sudo service netatalk restart

Oh and one more thing. To get netatalk to start on boot, run these commands:
sudo update-rc.d -f netatalk remove
sudo update-rc.d netatalk defaults

Feel free to add any extra volumes according to the configuration file. You're basically done. If you're lazy and don't want to compile it. I've compiled a .deb file already and you can get it from the link below. It's 32bit only. Cheers.

Compiled only the 32bit 3.0.1 version.

EDIT: 3.0.2 is out. Haven't tested it but the steps should be the same.

Download: http://cl.ly/3Z0r2y1j0Y46 32bit

13 comments:

  1. Thank you very much :)

    ReplyDelete
  2. hi - isn't avahi daemon necessary anymore?

    ReplyDelete
  3. Avahi daemon is still necessary. The only difference now is Avahi is automatically configured by netatalk so you don't have to mess with any pesky Avahi configuration files.

    ReplyDelete
  4. Thanks for helping people with a nicely written guide. Just one thing: DO NOT USE 3.0. It has a data corruption bug where files without extended attributes are incorrectly refcounted. I don't want to go into details, it takes way too much prerequisite knowledge about netatalk internals to explain.

    Just know that 3.0 should NOT be used under ANY circumstances, and that 3.0.1 fixes this severe bug. Delete your 3.0 package above so that people don't install it.

    You might also want to clean up the guide by removing all your outdated 3.0 workarounds since they are no longer needed.

    ReplyDelete
  5. This tutorial was invaluable in helping me set up my Debian TimeMachine server. Thank you so much!

    ReplyDelete
  6. I'm getting a weird error. I have libpam-cracklib installed but the .configure script reports an error:

    checking for main in -lcrack... no
    configure: error: cracklib not found!

    My upgrade ground to a halt.

    Lubuntu 12.10 (powerpc) running netatalk 2.2.2 just fine.

    ReplyDelete
    Replies
    1. If I remember correctly, that error comes from not having the cracklib headers. But you can just build netatalk 3.0 without cracklib, I don't think you'll use it. So just omit the part --with-cracklib from the build statement.

      Delete
  7. Got the following error... Any thoughts?


    In file included from netatalk.c:46:0:
    ../../libevent/include/event2/event.h:187:33: fatal error: event2/event-config.h: No such file or directory
    compilation terminated.
    make[2]: *** [netatalk-netatalk.o] Error 1
    make[2]: Leaving directory `/root/netatalk-3.1-beta1/etc/netatalk'
    make[1]: *** [install-recursive] Error 1
    make[1]: Leaving directory `/root/netatalk-3.1-beta1/etc'
    make: *** [install-recursive] Error 1

    **** Installation failed. Aborting package creation.

    ReplyDelete
    Replies
    1. Dear Anon, It looks as though to me you are missing the header files for libevent.

      Try installing the package 'libevent-dev' or the equivalent on your distribution

      Delete
  8. On Linux Mint 15 Olivia, works like a charm. Thanks a lot for the guide.
    A little note addendum: if you name the ATalk server machine using the same name of the Samba or NFS server, you will see on the Macs only one machine name. To name the server edit the netatalk.conf in:
    [Global]
    ; Global server settings
    hostname = %hostname%

    ReplyDelete
  9. Hi Zane,
    Thanks for the quick response!
    There was a little bit of a version inconsistency on my debian system....
    Thanks for your help!

    ReplyDelete