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

msp3k peek at nimbios.org
Mon Apr 26 17:14:24 BST 2010


Gürkan Sengün wrote:
> We've got 200 workstations for students, doctors, postdocs, professors
> and employees... the ugly hack on top works, however it's not the right
> solution, is it?
>   

There's already a precedent set by other services to include scripts in 
if-up.d/ and if-down.d/ to manage themselves in the event of a network 
state change, so I would say that this approach is kosher enough to call 
it correct.  (It just didn't work for me, and I couldn't tell you why 
not, so I implemented my horrible kludge instead and it works like a charm.)

I can also see that there are upstart scripts in if-up.d/ and if-down.d/ 
that emit "net-device-up" and "net-device-down", respectively, as a 
result of a network state change.  The problem is that autofs is still 
started via an /etc/init.d script, and not by upstart, so these signals 
may not have any bearing on the state of autofs.  But given Ubuntu's 
move to upstart I would image that future versions of autofs-ldap will 
include an /etc/init/ upstart script that is smart enough to make use of 
these signals and manage things properly.

...But as a thought experiment, I think it would be a bad idea for 
services like autofs to listen directly for a "net-device-*" signal.  
Systems with multiple network interfaces may, depending on their use, 
bring network interfaces up and down often that would have no effect at 
all on the state of their directory service or the ability for autofs to 
function correctly.

Perhaps the proper solution, then, should also involve modifying the 
LDAP and NIS packages to include functionality that will specifically 
emit their own up or down signals, but only in the event that the 
associated network interface through which directory services are bound 
change state.

For instance, let's say that a system has six network interfaces: eth0 
through eth5.  The system is bound (via LDAP or NIS) to a server that is 
only available via the eth3 interface.  You don't want autofs to shut 
itself down whenever it sees a "net-device-down" signal, because unless 
that signal is in response to bringing eth3 down then directory binding 
would continue to work properly.

The LDAP (or NIS) package could include an upstart script that listens 
for "net-device-up" and "net-device-down" signals.  When one is 
received, check the connection to the directory server (be it LDAP or 
NIS).  If "net-device-down" was received and the the directory server is 
now unreachable, then a "directory-binding-down" should be emitted.  
Likewise, if a "net-device-up" signal was seen, then a timeout should be 
started where the upstart script waits for directory binding to 
succeed.  If it does, then a "directory-binding-up" should be emitted.  
If it times out first, emit "directory-binding-down".

Other services that rely on directory binding, such as the autofs-ldap 
package, could listen specifically for the "directory-binding-down" and 
"directory-binding-up" signals and know that it is now okay to take 
appropriate action.

(...There's probably a better way to handle this, but this was an 
off-the-hip shot.)

Michael

-- 
Autofs should be reloaded when state of network interface changes
https://bugs.launchpad.net/bugs/119660
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