NFS Automount and the "open" command

Discussion in 'macOS' started by Kevad, Jul 23, 2007.

  1. Kevad macrumors newbie

    Joined:
    Dec 14, 2005
    #1
    We use automount for our linux machines here quite often, and I decided to set it up on my Mac. I built a map file (auto.map) that looks similar to the following:

    Code:
    kevad   server:/vol/users/kevad
    user2    server:/vol/users/user2
    ...
    
    I then mount it with the "sudo automount -m /u /etc/auto.map" and the symlinks show up properly in /u. If I traverse the directories, I see all the appropriate files and can list and edit files in vi, etc.

    However, when I try using the "open file.txt" command to open the file in my default text OSX editor (TextMate), the application is brought to the foreground but the file is never opened. The strange part is that if I statically mount this server using "mount_nfs", the "open file.txt" opens the file in TextMate properly.

    Any ideas on what could be causing this or where I can look to troubleshoot?

    Thanks,
     
  2. Kevad thread starter macrumors newbie

    Joined:
    Dec 14, 2005
    #2
    I actually ended up moving to amd (http://www.am-utils.org) via macports and a few custom scripts, and can now correctly use the "open" command.

    However, I'd still be very interested in getting Apple's automount utility working if anyone has any ideas.
     
  3. dr_lha macrumors 68000

    Joined:
    Oct 8, 2003
    #3
    I don't know why you saw the odd behaviour, but you set up your automounts incorrectly, which might explain why things are odd. I have automount/NFS set up on our Macs at work (which integrate with a Linux server) and it works fine. Your main issue from what I see is that you set up the mountpoints the "linux way", rather than the "Mac way". You don't put the mountpoints in a file, but into the netinfo system.

    The correct way to set up NFS automounts on a Mac system is detailed here:

    http://sial.org/howto/osx/automount/

    Although this is a little out of date, the basics still work.
     
  4. Kevad thread starter macrumors newbie

    Joined:
    Dec 14, 2005
    #4
    According to the same document you referenced, the file mode I'm using is also supported. I just used file mode since it's very simple and I can easily import maps from our linux machines without loading and unloading from Netinfo


    http://sial.org/howto/osx/automount/#s5

    However, even when using NetInfo I still saw the strange "open" behavior. The automounts were working fine, in the fact that I could see and edit files just fine from the cli. However, anytime I tried opening a file in an OS X application it did not work.

    Very strange problem. Thanks for the suggestion though!
     
  5. dr_lha macrumors 68000

    Joined:
    Oct 8, 2003
    #5
    Yeah, it was worth a try! Didn't see any good reason why that would not work though.

    I'm wondering if it has anything do to with the way that automount on Mac put the "real" mount points someone other than where you specify. For example in my mount list I have the following mount:

    everest:/data/bulk /ext/bulk nfs -P 0 0

    (I use the fstab format and import into NetInfo using "niload -m fstab . < /etc/fstab")

    If I go into the /ext directory I see the "bulk" directory, but its actually a symlink to:

    /private/var/automount/data/bulk

    AFAIK this is a Mac specific way of doing things.

    That said, I've never had an issue using "open" on any of my nfs drives.

    As all automount does is mount a NFS share, the use of a direct link and a symlink for the mount point is the only difference I can think of. You might try doing an "open" and the full path to see if that works?
     
  6. Kevad thread starter macrumors newbie

    Joined:
    Dec 14, 2005
    #6
    I had read about the "symlink" solution in Mac OS X, and was one of the first things I thought was causing problems as well. Moving to the actual directory didn't change the behavior I saw, unfortunately.

    "open ." actually does bring up the Finder in that particular directory under this circumstance, but double clicking a file from there has the same effect of opening the application, but not the actual document.

    Very strange...but I'm glad I was able to figure out an amd solution.
     

Share This Page