[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#769561: debian-edu-config: autofs fail to work when dhclient is slow to set up network



Package: debian-edu-config
Version: 1.813
Severity: important
Tags: patch pending

Some times, when booting a Debian Edu Jessie Workstation or another
profile using DHCP, the autofs process do not work after boot.  The
reason is that the process start before the DHCP client is done setting
up the network interface.  The autofs process is then unable to look up
the LDAP server DNS name and unable to look up the automount maps in
LDAP.  We suspect this is caused by bug #710490 in autofs.

A workaround is to reload autofs when dhclient is done setting up the
interface.  The following patch implement this approach, and with this
in place, I have not been able to trigger the problem on a network with
a very slow DHCP server.

The patch is already commited to git.

diff --git a/Makefile b/Makefile
index 2586b7d..b5a1c04 100644
--- a/Makefile
+++ b/Makefile
@@ -100,6 +100,7 @@ SYSCONFFILES = \
        cfengine/update.conf \
        cfengine/inputs/cfagent.conf \
        cups/cupsd-debian-edu.conf \
+       dhcp/dhclient-exit-hooks.d/autofs-reload \
        dhcp/dhclient-exit-hooks.d/wpad-proxy-update \
        dhcp/dhclient-exit-hooks.d/fetch-ldap-cert \
        dhcp/dhclient-exit-hooks.d/hostname \
diff --git a/etc/dhcp/dhclient-exit-hooks.d/autofs-reload b/etc/dhcp/dhclient-exit-hooks.d/autofs-reload
new file mode 100755
index 0000000..7276ba1
--- /dev/null
+++ b/etc/dhcp/dhclient-exit-hooks.d/autofs-reload
@@ -0,0 +1,20 @@
+#!/bin/sh
+# Workaround for 710490 where autofs cache failing DNS entries
+# when started before the network is up.
+
+if [ -r /etc/debian-edu/config ] ; then
+    . /etc/debian-edu/config
+fi
+
+if [ false = "$DHCP_AUTOFS_UPDATE" ] ; then
+    exit 0
+fi
+
+case $reason in
+    BOUND|RENEW|REBIND|REBOOT)
+       logger -t autofs-reload "reloading autofs from dhcp exit hook"
+       service autofs reload
+       ;;
+    EXPIRE|FAIL|RELEASE|STOP)
+       ;;
+esac

-- 
Happy hacking
Petter Reinholdtsen


Reply to: