Forcing AFP discovery over SMB for the same server?

Discussion in 'macOS' started by rogersmj, Nov 17, 2007.

  1. rogersmj macrumors 68020

    rogersmj

    Joined:
    Sep 10, 2006
    Location:
    Indianapolis, IN
    #1
    On my home file server (Ubuntu 6.10 Server) I have both Samba and AFP running; most of the time I prefer to use AFP, but I keep Samba on there for when a PC needs access. In the Leopard Finder sidebar, under "Shared", it sees the server via its Samba shares (and hence labels it as a "PC server") but not the AFP shares. I can manually connect via AFP using "Connect to server...", but I'd like it to just show up in the sidebar automatically. Anyone know how to do this?
     
  2. stomer macrumors 6502a

    Joined:
    Apr 2, 2007
    Location:
    Leeds, UK
    #2
    You need to somehow advertise the afp service. You can do this by installing Avahi.


    Code:
    $ sudo apt-get install avahi-daemon
    $ sudo vi /etc/avahi/services/afp.service
    
    Then you'll need to enter something like this:
    Code:
    <?xml version="1.0" standalone='no'?><!--*-nxml-*-->
    <!DOCTYPE service-group SYSTEM "avahi-service.dtd">
    
    <service-group>
        <name replace-wildcards="yes">%h</name>
        <service>
            <type> _afpovertcp._tcp</type>
            <port>548</port>
        </service>
    </service-group>
    Then reload the avahi config:
    Code:
    $ sudo /etc/init.d/avahi reload
    
    I've not tested this so I don't know if it works. If it doesn't work, then you'll need to google for the correct service type and port.
     
  3. rogersmj thread starter macrumors 68020

    rogersmj

    Joined:
    Sep 10, 2006
    Location:
    Indianapolis, IN
    #3
    Fantastic, that's what I was looking for. I got Avahi installed and it works great. Thank you.
     
  4. rogersmj thread starter macrumors 68020

    rogersmj

    Joined:
    Sep 10, 2006
    Location:
    Indianapolis, IN
    #4
    OK I have a big problem now. I discovered that AFP doesn't support symlinks; for one of my shares, this is completely unacceptable. Those links just don't do anything when you see them in the share via Leopard's Finder; it treats them like orphaned aliases. So I reverted that share back to Samba; Leopard still acted like it didn't know what the symlinks were (keep in mind, this all worked before I enabled Avahi on the server). I completely shut off Netatalk (AFP) and Avahi on the server, so now I can only connect to it via Samba, and Leopard still shows me dead links, on both my iMac and my wife's MacBook. When I connect to the share with Windows XP, I can browse through those symlinks just fine. What's going on? I've already disabled Netatalk and Avahi. My Apple TV has no problem browsing the shares either; just Leopard.
     
  5. rogersmj thread starter macrumors 68020

    rogersmj

    Joined:
    Sep 10, 2006
    Location:
    Indianapolis, IN
    #5
    Solved my problem; the newer version of Samba I installed today apparently started exporting UNIX extensions to clients that support them (namely, Leopard), which includes the "feature" of interpreting symlinks on the client computer (as AFP does). Why in the name of God anyone would EVER want to interpret symlinks anywhere other than the server is beyond me, but that's what's causing the problem. I had to add "unix extensions = no" to my smb.conf file.
     

Share This Page