13

I'm trying to get my host machine running Lion to automount an NFS export on my CentOS VM.

I was able to get this working on a system running Mac OS 10.5 by modifying /etc/auto_master and then restarting the autofs service per the instructions in http://alanlam.blogspot.com/2008/06/restart-autofs-in-leopard-without.html:

sudo service com.apple.autofsd stop
sudo service com.apple.autofsd start

However, in Lion, the service command appears to be missing.

How do I reload the autofs service in OS X Lion without restarting?

1
  • Does launchtcl show the com.apple.autofsd as a job that is loaded? Launchd really should be controlling this for you and logging why and when a halt / respawn or error happens.
    – bmike
    Aug 11, 2011 at 20:49

2 Answers 2

23

this works for me:

sudo automount -vc
1
  • 1
    Forgot about that; thanks! I like this better, since it is a 'reload' operation rather than a 'restart'.
    – user5118
    Aug 7, 2011 at 19:02
5

You can use launchctl instead of service:

sudo launchctl stop com.apple.autofsd

You should not need to restart autofsdt manually; launchd will notice that it has stopped, and immediately start another instance.

1
  • this works under Catalina (10.15).
    – user47093
    Mar 13, 2020 at 20:26

You must log in to answer this question.