Re: (missing) pre-up and pre-down

2009-08-13 Thread Simon Geard
On Wed, 2009-08-12 at 12:43 -0500, Dan Williams wrote:
 On Sat, 2009-08-08 at 01:50 +0100, Graham Lyon wrote:
  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...
 
 That was my thinking too, and probably the right thing to do.

Isn't that basically the same as a post-down script then? Even with such
a flag, running the pre-down scripts after the connection has already
gone down seems wrong...

Seems to me that the way to handle pre-down scripts is with the very
clear statement that they're run only on a manual disconnection, that
being the only circumstance where NM (or any other hypothetical system)
knows the connection is about to be dropped...

Simon.


signature.asc
Description: This is a digitally signed message part
___
NetworkManager-list mailing list
NetworkManager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: (missing) pre-up and pre-down

2009-08-12 Thread Dan Williams
On Sat, 2009-08-08 at 01:50 +0100, Graham Lyon wrote:
 
 
 2009/8/7 Dan Williams d...@redhat.com
 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...

That was my thinking too, and probably the right thing to do.

Dan

 Just two my cents
 
 -Graham
 
 ___
 NetworkManager-list mailing list
 NetworkManager-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/networkmanager-list

___
NetworkManager-list mailing list
NetworkManager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list