Re: Problem automatically unmounting VPN shares



On Sat, 2012-07-28 at 18:18 -0300, Lamarque V. Souza wrote:
> Em Saturday 28 July 2012, Robby Workman escreveu:
> 
> > On Sat, 28 Jul 2012 12:50:13 +0100
> 
> > 
> 
> > Peter Rockett <p rockett sheffield ac uk> wrote:
> 
> > > Hi
> 
> > > 
> 
> > > I am trying to automatically mount and unmount a share at my
> office.
> 
> > > I have a script in /etc/NetworkManager/dispatch.d which runs along
> 
> > > the lines:
> 
> > > 
> 
> > > #!/bin/bash
> 
> > > 
> 
> > > case "$2" in
> 
> > > 
> 
> > > vpn-up)
> 
> > > 
> 
> > > exec mount blah-blah-blah
> 
> > > ;;
> 
> > > 
> 
> > > vpn-down)
> 
> > > 
> 
> > > exec umount blah-blah-blah
> 
> > > ;;
> 
> > > 
> 
> > > esac
> 
> > > 
> 
> > > which mounts the share in my home directory (on Ubuntu 11.10 +
> 
> > > Network Manager v. 0.9.1.90). I swear this all worked fine when I
> set
> 
> > > it up in 2010. But some time in the intervening period it has
> broken.
> 
> > > (I am infrequent user of VPN since I got DropBox!) I have also
> 
> > > upgraded from Natty to Oneiric in the meantime...
> 
> > > 
> 
> > > Now, VPN connects fine, the remote share is mounted OK. I can
> 
> > > see/access all the remote files. But when I disconnect from VPN,
> the
> 
> > > running of the umount seems to go very wrong. After disconnect, if
> I
> 
> > > open a terminal and type "ls" to list the contents of my home
> 
> > > directory (the mount point), the "ls" command hangs. (Nautilus
> also
> 
> > > hangs - either it won't start or, if it was running already, it
> 
> > > hangs.) Everything else in the OS seems to work OK. It seems for
> all
> 
> > > the world as if the mount point is getting screwed and the only
> 
> > > recovery is to restart (in which the shutdown takes much longer
> than
> 
> > > usual).
> 
> > > 
> 
> > > The weird thing is that, if I delete the dispatcher script above,
> 
> > > connect to VPN, mount the drive manually in a terminal, then
> umount
> 
> > > it manually, and disconnect from VPN, everything is fine and as it
> 
> > > should be. So it seems like the dispatcher daemon is making a mess
> of
> 
> > > running the unmount... but not the mount.
> 
> > > 
> 
> > > Any ideas where to go with this?
> 
>  
> 
> What is happening is that NetworkManager is taking down the connection
> before running the dispatch script. That is a known problem.

Yes, this is a known issue, and I'm working towards that in the
'dispatcher' branch in git.  That has a rework of a bunch of dispatcher
stuff, and the next issue is ensuring that all the cases of terminating
a connection via user-request enter the DISCONNECTING state, where
"pre-down" stuff would run, before killing the connection completely.

Note that, as I've said before, whatever scripts you use *must* be able
to cleanly terminate a failed VPN connection, since this will still
periodically happen due to network stupidity and other issues.  We'd
expect that choosing 'Disconnect..." from a menu to trigger a clean
disconnect, but if your WiFi AP goes out of range or your 3G connection
fails, you're out of luck and you need to make sure your script can
handle an unexpected disconnect.  NM will help out by making sure these
are two separate events, but the script still needs to deal with both.

Dan



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