2009/8/7 Dan Williams <[email protected]>

> On Wed, 2009-08-05 at 11:30 +0100, Marc Herbert wrote:
> > Dan Williams a écrit :
> > >
> > > There are two reasons I've not yet added pre-up and pre-down.  They
> are:
> > >
> > > 2) appropriateness
> >
> > Hmmm, the good old "just do not do this" answer... the best answer to
> > any feature request ever ;-) Especially to people having using this
> > feature for ages and being suddendly deprived of it.
>
> Please note I didn't say *all* uses were inappropriate.  Just that
> because we've done something the same way forever, doesn't *necessarily*
> mean that it should always be done that way until the end of time.
>
> >
> > >     b) by the time any pre-down script will run, often the connection
> > > has already gone away (the AP is out of range, the cable has been
> > > unplugged already, etc) so any operation a pre-down script does
> *cannot*
> > > depend on the interface being up; it must gracefully fail.  Common
> > > things people wanted to do here were unmount network shares;
> > > but since the script must always handle unexpected disconnects (which
> > > not all network file systems do well), you might as well just run this
> > > from post-down anyway.
> >
> > I think "pre-down" cleanup scripts could (should?) simply NOT be run on
> > unexpected disconnects (as opposed to explicit disconnection
> > requests). Simply because they are called PRE-down, not AT-down.
>
> I did think about this a lot while composing the mail, and couldn't come
> up with a good reason to not run pre-down scripts on unexpected
> disconnect.  I don't really care either way.


Not running them on unexpected disconnects would breed inconsistency and
would be confusing for tracking issues/users who aren't aware of this quirk.
Running them on unexpected disconnections would be pointless - they are
scripts that, by definition, expect the interface to be up. There's no
winning.

Perhaps when a connection drops unexpectedly the pre-down scripts should be
run with an argument of some kind to inform them that the interface has
already dropped? That way they can clean up the mess that's created but
avoid any action that requires the interface to still be up...

Just two my cents

-Graham
_______________________________________________
NetworkManager-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/networkmanager-list

Reply via email to