This is an old revision of the document!


Mac OSX

This page is intended to offer some guidance to Mac users. The DNS-323 natively supports SAMBA (Windows) shares and so technically this means it supports Mac users, but there are a few things that you can do to make your lives a little easier!

SAMBA vs. AFP

Although SAMBA typically takes a lot of flack from Mac users, if correctly configured, the DNS-323 will play nicely. The biggest problem seems to be the lack of native mDNS support. Initially, I found the DNS-323 SAMBA mount points to be extremely slow and cumbersome in OSX compared to Windows XP. Connecting to a share (either manually in Finder via the “Go” menu, or by clicking on it under “Shared”) was painstakingly slow.

I configured AFP using Fonz' Fun-plug 0.5, and found it really snappy, but the problem remained that there was no easy way to simply select the NAS under the “Shared” section in Finder, and establish a connection via AFP. Connecting via “Go” → “Connect to server” was quick, but if I tried to browse under the “Shared” section, Finder would hang, then connect via SAMBA. I discovered that the trick was to correctly configure AVAHI/mDNS/zeroconf/Bonjour on the NAS. As soon as I did so, the differences between SAMBA and AFP were unnoticeable (at least to me).

Adding Bonjour support to the DNS-323

The easiest way to proceed is to install optware, then download and configure the avahi package. Although the process really isn't that complicated, there are a few gotchas which I will attempt to explain. Here are the steps to configure Avahi (the Linux Zeroconf implementation of Apple's Bonjour).

  1. Install FFP 0.5. Basically, download fun_plug and fun_plug.tgz from the following site and copy them to “Volume_1” of the DNS-323, then reboot. FFP 0.5 installs itself and you can telnet in.
  2. Here are the instructions for installing FFP and configuring SSH (http://wiki.dns323.info/howto:ffp)
  3. Install optware, following these instructions: (http://wiki.dns323.info/howto:optware)
  4. The optware startup script specified on the optware how-to page works, you just need to comment out the lines that echo details to the log. They really serve no purpose. If you want them, just specify the LOGFILE variable at the top of the script. You can't skip this step… it ties /opt to your ipkg opt directory.
  5. Be sure to add the path directive from the script to the /ffp/etc/profile file, since we installed FFP 0.5. If you don't, you'll have to manually locate “ipkg” as well as all of the other binaries that you install under /mnt/HD_a2/opt/.
  6. Install the avahi package (ipkg install avahi).
  7. Next you need to create a few groups/users for dbus and avahi to correctly function. Create the following groups, using the “addgroup” command:
    • addgroup avahi
    • addgroup messagebus
    • addgroup netdev
  8. Now create the following users:
    • adduser -S -G avahi -D -H avahi
    • adduser -S -G messagebus -D -H messagebus
  9. Next, edit the /etc/group file to add the 'messagebus' and 'avahi' users to the 'netdev' group that you created above. the line should look like this:
    • netdev:x:3:messagebus,avahi
  10. Type “store-passwd.sh” to save the modifications to /etc/passwd and /etc/group to flash, so that they are persistent, after you reboot.
  11. Now you need to add one or more Avahi services.
  12. Change into the /opt/etc/avahi/services directory. You will see two existing files; one for ssh and one for sftp. You'll want to create one for your SAMBA shares, and possibly one for AFP (if you've installed the AFP module for FFP 0.5 or via optware.)
  13. The SAMBA file that you create (call it smb.service) looks like this:

<?xml version=“1.0” standalone='no'?><!–*-nxml-*–>
<service-group>
<name replace-wildcards=“yes”>%h (Windows)</name>
<service>
<type>_smb._tcp</type>
<port>139</port>
</service>
</service-group>

  1. If you create an AFP service, call it afp.service and it should contain the following:

<?xml version=“1.0” standalone='no'?><!–*-nxml-*–>
<!DOCTYPE service-group SYSTEM “avahi-service.dtd”>
<service-group>
<name replace-wildcards=“yes”>%h (Mac)</name>
<service>
<type>_afpovertcp._tcp</type>
<port>548</port>
</service>
</service-group>

  1. Note that you can rename the service as you see fit, by changing the <name …> tag from ”%h (Mac)” or what have you, to whatever you like.
  2. Next you need to create a script to start dbus and avahi. I actually just added a couple of lines to the optware script that I put in /ffp/start (the one the ties /mnt/HD_a2/ipkg/opt to my /opt folder), back when I installed optware. Here is what I added:

# Start-up DBUS
rm -rf /opt/var/run/dbus/*
/opt/etc/init.d/S20dbus start

# Start avahi-daemon
/opt/sbin/avahi-daemon -D

  1. Note that the rm command deletes the PID for the previously running instance of dbus (in the event that you shutdown or reboot) since the shutdown routine does not correctly remove the PID and socket files itself. If you omit this command, the first time you reboot, or try to restart dbus, it will fail because there is an existing PID, making it think it is already running.
  2. Afer the script starts dbus, it starts avahi and loads your service files.
  3. This SHOULD be all that you need to do. At this point if you run a “ps” from the console, you should see both dbus and avahi running (it will specify the avahi hostname in brackets).
  4. If you can't see the processes, try executing ”/opt/etc/init,d.S20dbus start”, and “avahi-daemon” manually to see if there are some errors.
  5. So, if everything worked, now when you open Finder in OSX, you should see a line under “Shared” for each service that you created. If you click on the AFP service, it will try to connect via AFP and you can choose “connect as” to specify a user/pass combo. If you click on the SAMBA service, it should immediately connect via SAMBA and/or let you click “connect as” to specify your Network Access credentials. The key here is that the delay is gone, because the SMB and AFP services are explicitly defined :)
  1. Email me know if you have any problems! (trepex at gmail dot com)

Navigation

Personal Tools