12 Replies Latest reply: Jan 23, 2010 10:29 AM by etresoft
Nerdilicious! Level 1 Level 1 (0 points)
I was playing around with autofs maps at the weekend, and after one restart the /home and /net folders were viewable in the Finder. I reset auto_master to the default settings, restarted and those folders were still there (as folders, not as aliases/symlinks). I deleted these folders and restarted again. The folders reappeared. and are still visable.

Now, I can make these folders dissappear by typing automount -vc in Terminal (i.e. they start behaving as they're supposed to), but on restart... the folders reappear.

Question is, how do I make this work properly?

I also have access to a MacBook that doesn't have this problem. Typing ps axww on both machines reveals that the MacBook is running both autofsd and automountd, whereas my MacBook Pro is only running automountd. Therefore, I presume launchd is failing to start autofsd on startup, but I don't know how to make launchd behave, if that were possible. I've tried various launchctl commands (which I've forgotten) so I'm like a dwarf with no legs: a little stumped.

MacBook Pro 17" 2.33GHz, Mac OS X (10.6.2)
  • 1. Re: Automount not automounting on startup
    twtwtw Level 5 Level 5 (4,690 points)
    what do you get when you run {color:blue}sudo launchctl list | grep autofsd{color}? is there a job listed with an error code, or is there no listing at all? if the former, you might have bolluxed the conf file or the auto_master file (might be something trivial and annoying, like unexpected whitespace or improper permissions). if the latter, did you play with any of the launchd plist files?
  • 2. Re: Automount not automounting on startup
    Nerdilicious! Level 1 Level 1 (0 points)
    I'm not near my computer till this evening, but if I remember correctly I did run *launchctl list | grep autofsd* (I think I ran it under sudo) and it returned a blank, rather than an error. I haven't edited the plist files.

    I did try *launchctl stop com.apple.autofsd* and *launchctl start com.apple.autofsd*, but these returned a 'not found' error of some description. However, the corresponding plist file is present in /System/Library/LaunchDaemons and is the same as on my girlfriend's MacBook (which works as expected). I have run Repair Permissions and the problem still persists.
  • 3. Re: Automount not automounting on startup
    twtwtw Level 5 Level 5 (4,690 points)
    Nerdilicious! wrote:
    I'm not near my computer till this evening, but if I remember correctly I did run *launchctl list | grep autofsd* (I think I ran it under sudo) and it returned a blank, rather than an error.


    'sudo' is necessary - launchctl wont report root processes to a normal user without it.

    Nerdilicious! wrote:
    I did try *launchctl stop com.apple.autofsd* and *launchctl start com.apple.autofsd*, but these returned a 'not found' error of some description. However, the corresponding plist file is present in /System/Library/LaunchDaemons and is the same as on my girlfriend's MacBook (which works as expected). I have run Repair Permissions and the problem still persists.


    stop, start and remove are for jobs that are already loaded into launchd (start forces a single run, stop forces the process associated with a job to quit, remove removes an active job from launchd). what you'd want to use is 'load': *launchctl load '/System/Library/LaunchAgents/com.apple.autofsd.plist'*
  • 4. Re: Automount not automounting on startup
    Nerdilicious! Level 1 Level 1 (0 points)
    When I type *sudo launchctl load /System/Library/LaunchDaemons/com.apple.autofsd.plist* into Terminal, I get a "nothing found to load" error. However that plist file is there and has the correct size, ownership and permissions.

    The plist file itself refers to /usr/libexec/autofsd - this file also exists and has correct size/ownership/permissions.

    Just thought of something - I'll be right back...


    ... and here I am. I've just returned from Terminal and typed in the very same command as at the beginning of this reply, but this time with added force:

    *sudo launchctl load -F /System/Library/LaunchDaemons/com.apple.autofsd.plist*

    This has loaded autofsd (yay!) but It remains to be seen if it remains loaded after a restart. Let's see…
  • 5. Re: Automount not automounting on startup
    Nerdilicious! Level 1 Level 1 (0 points)
    Nope. After restarting, *sudo launchctl list | grep auto* returns the following:

    - 0 com.apple.preferences.timezone.auto
    - 0 com.apple.backupd-auto
    - 0 com.apple.automountd

    Gah!
  • 6. Re: Automount not automounting on startup
    twtwtw Level 5 Level 5 (4,690 points)
    if the Force option works, that means that the plist has a Disabled key set to true. that is not the default on 10.5.8; if it's that way on your machine then either Apple has intentionally disabled it on 10.6.2 or you (or some process on your machine) accidentally disabled it. you can fix the problem (if it is a problem) by setting the Disabled key to false in the plist, but you should check to make sure it's not supposed to be disabled before you do that.

    Message was edited by: twtwtw
  • 7. Re: Automount not automounting on startup
    Nerdilicious! Level 1 Level 1 (0 points)
    Before racing out to work, I looked at the autofs.plist file in Lingon and it said that it was enabled.
  • 8. Re: Automount not automounting on startup
    Nerdilicious! Level 1 Level 1 (0 points)
    I've compared the /System/Library/LaunchDaemons/com.apple.autofsd.plist file from my Mac with my girlfriend's and they are exactly the same:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    <key>Label</key>
    <string>com.apple.autofsd</string>
    <key>KeepAlive</key>
    <true/>
    <key>Program</key>
    <string>/usr/libexec/autofsd</string>
    <key>ProgramArguments</key>
    <array>
    <string>autofsd</string>
    </array>
    <key>EnableTransactions</key>
    <true/>
    </dict>
    </plist>

    If my autofsd is perfectly OK (apart from the not-loading bit), then could the problem originate earlier in the startup process?
  • 9. Re: Automount not automounting on startup
    Nerdilicious! Level 1 Level 1 (0 points)
    I'm still plugging away on this, so I tried the following on a whim on both Macs:

    *sudo find -H /System -exec grep "autofs" '{}' \; -print*

    Guess what? Exactly the same output on the two machines. Now, does that mean we can look elsewhere from the /System folder for my particular fault? Or have I missed something?
  • 10. Re: Automount not automounting on startup
    Nerdilicious! Level 1 Level 1 (0 points)
    Still no answers. I'm not sure what else I can do!
  • 11. Re: Automount not automounting on startup
    Nerdilicious! Level 1 Level 1 (0 points)
    So there was little me. Stumped. What else could I do? I tried *sudo launchctl load /System/Library/LaunchDaemons/com.apple.autofsd.plist* again. I got the +nothing found to load+ error again. Futile? Why yes.

    And no.

    Because this time, I tapped this string into Google: *+launchctl +"nothing found to load"* and came across this blog entry: http://www.cuddletech.com/blog/pivot/entry.php?id=403

    *Contained therein is the answer: use the -w switch with +launchctl load+.*

    So to answer my question, type this into Terminal as an administrator:

    *sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.autofsd.plist*

    And this works! And, yes, it still works after rebooting or a power cycle.
  • 12. Re: Automount not automounting on startup
    etresoft Level 7 Level 7 (24,270 points)
    Why don't you just comment out home and net in auto_master?