[Bug 119660] Re: Autofs should be reloaded when state of network interface changes

msp3k peek at nimbios.org
Mon Nov 30 20:43:15 GMT 2009

For me, adding the above script to /etc/network/if-up.d/ didn't work.
But I was able to address the issue with the following horrible kludge.
Since this whole problem will likely be addressed via the new upstart
paradigm, I thought I would base my fix on upstart.  It could just as
easily be put into an init.d script instead.

file: /etc/init/fix-autofs.conf
# fix-autofs - Check for and fix LDAP/AutoFS race condition error
# When NIS or LDAP is used in conjunction with AutoFS a race condition is
# introduced into the system where, when AutoFS is started before the network
# is completely up, AutoFS will exit, as it won't be able to find any of it's
# configuration information.

description "AutoFS/LDAP Race Condition Fix"

start on runlevel [2345]

  # Using ldapsearch here to pass the time until LDAP binding is up.
  # Edit the search term 'ou=automount' to taste...
  while ! /usr/bin/ldapsearch -xLLL 'ou=automount' > /dev/null 2>&1 ; do
    echo "Waiting for LDAP to bind..."
    sleep 1
  if ! /usr/bin/pgrep automount > /dev/null 2>&1 ; then
    echo "AutoFS is not running, attempting to start..."
    # Seriously?  Using an upstart script to call invoke-rc.d?
    # Yes.  There is no upstart configuration file for autofs (yet).
    /usr/sbin/invoke-rc.d autofs restart
end script

Autofs should be reloaded when state of network interface changes
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to autofs in ubuntu.

More information about the Ubuntu-server-bugs mailing list