Re: Unmount drives before closing PPTP vpn



On Dec 3, 2007 3:36 PM, Dan Williams <dcbw redhat com> wrote:
> On Sat, 2007-12-01 at 23:26 +0100, mr wizard wrote:
> > I'm running Ubuntu 7.10 at the moment and I'd like to unmount some
> > network drives when I close my PPTP VPN connection. I found
> > NetworkManagerDispatcher, but that doesn't seem to care about VPNs or
> > ppp connections at the moment.
>
> One thing to think about: the VPN gets torn down when you loose your
> connection.  So does your unmount operation still work OK (and not block
> until a TCP timeout or something) when the connection is already torn
> down and you no longer have a route through the VPN?  This will _always_
> be the case, even if there is eventually an advisory VPN termination
> signal.  There will always be the case of an interrupted connection.

In the case of a lost connection this is always the case, yes. That is
not very common for me though, as I generally use a wired connection.
I'm talking about the user asking NetworkManager to shut down the vpn
(through the applet, in my case).

I currently have to take the following steps to get work done, and I'm
trying to automate it as much as possible:
1. connect to vpn
2. mount network drives with same username and password as the vpn
3. work
4. unmount network drives
5. disconnect vpn

It does appear that there is no way to get notified by NetworkManager
when I ask it to bring the vpn down (even by writing my own DBUS
signal listener, which was easier than I expected it to be) in such a
way that there is always enough time for my script to cleanly unmount
the drive. This is something that could be fixed by waiting a short
while between sending the notification and actually killing pppd.

In any case, I have somewhat succeeded in automating the first two
steps with the attached script. The way it works does make me rather
uncomfortable, especially with nm-ppp-auth-dialog dumping passwords
from the keyring to stdout. It also still requires me to run this
script manually instead of using the applet.

Regards,

Ronald.

Attachment: vpnmount
Description: Binary data



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