"/etc/init.d/NetworkManager quit" ?



Dan Williams a écrit :
> On Thu, 2010-02-25 at 12:58 +0000, Marc Herbert wrote:
>> I am using NM 0.7.1, sorry if this has changed or already been discussed.
>>
>> Why does NM force all links down when exiting? Does this serve any
>> purpose?  This kills basic IPv6 connectivity, something NM is not needed
>> for. Actually, this kills any other (less common) protocol you can think of.
> 
> The main reason is that there's a ton of state when network devices are
> up; PPP for 3G connections, wpa_supplicant for wifi and wired 802.1x,
> VPN daemons, etc.  It's simply too complex to re-acquire all that state
> and verify it when NM starts again.

I wrote "all links" but I actually had only physical links in mind,
sorry about that.

Ideally NM would tear down on exit everything that it set up itself,
wouldn't it?  I mean no more, no less.  But NM 0.7.1 takes a wired
ethernet link down on exit even when it was up before. I can imagine
that NM does not want to bother remembering the initial wired link
state. But then it could have just erred on the side of caution and left
the link up on exit? Well, never mind.



> NM 0.8.x does not do this for ethernet devices where the connection can
> be taken over again on startup.
>   [...]
> For wired connections that use static IP or DHCP, NM 0.8? will not take
> the device down on exit, and will seamlessly take the device over on
> startup as long as the DHCP lease has not expired.

Interesting... What use case(s) motivated this change? (besides mine :-)

I am afraid that this new "half stop" is going to confuse people.  In
most systems "/etc/init.d/NetworkManager" is replacing
"/etc/init.d/network[ing]". The latter, older one used to connect the
system on "start" and disconnect it on "stop". Simple. Now the new one
will disconnect the system... sometimes. Sometimes not. And it might
even leave a running process behind. This will surprise people.

So maybe there should be a new "quit" command?

- full "stop" would disconnect everything, exactly like
  "/etc/init.d/network stop" did before NM.

- Now for unusual cases where (remotely logged in...) people want NM to
quit without disconnecting, there would be a new, semi-hidden "quit"
command that would leave everything running behind (dhclient,
wpa_supplicant, pppd, etc.). And "start" would then first try to
clean-up any leftovers. But without any guarantee of success: for a
guaranteed "start" you should have used a proper "stop".


Such a "quit" was not needed with the older "/etc/init.d/network" since
there was no "network" process running.



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