On Fri, Mar 30, 2007 at 04:02:42AM +0300, Eddy Petrișor wrote:
> > Uh, putting your comments on the process *in-line as shell comments* is very
> > difficult to read; you also show three tests but only show the contents of
> > /etc/network/interfaces in two of them, which I find confusing.  It would be
> > a lot clearer if you would summarize your findings.

> Ok, I added comments/summaries above each test (in fact 4 of them).

Ok, thanks.

So it happens that I've just done my first real etch install onto a new
laptop.  The desktop is great, but network-manager is /awful/ for my
purposes; not because I don't want a desktop applet managing my connection
-- I in fact do want this -- but because it stores all my wep keys under
lock and key, and as a result my wifi connection isn't brought up until I
log into the GUI.  This is doubly-broken for me because I want to be able to
use Kerberos for network-based login *at* the GUI...

None of this is anything that I think should be RC for etch, though I look
forward to trying to help find a solution better-integrated with ifupdown
for lenny.  In the meantime, I'll probably install waproamd for my own use.

> Summaries are separated between some visible markers.

> > It is certainly the case that /etc/init.d/networking should have no effect
> > on interfaces that are not marked 'auto'.

> allow-hotplug ones should be managed, too (according to the README.Debian
> examples)

Uh, I don't understand what you mean by "too".  I was talking about what
*ifupdown* does with interfaces that are not marked 'auto', which is:
nothing.  The interface is only managed by /etc/init.d/networking if it's
marked 'auto'; if it's marked allow-hotplug and *not* marked auto, it's
managed via the hotplug system exclusively.

> > fact that it is possible in the NM applet to *override* the status of an
> > interface sounds to me like a feature, not a bug.

> That would be ok *if* I would still be able to use the init script to stop
> and start networking from the console. Since X might not start, it might
> not allowing me to maneuver networking from the console until I:

> 1) remove NM from the system,
> 2) start in X and use NM to start it (which leaves the init script broken with
> allow-hotplug, and partly broken with auto)
> 3) add a dummy hook to the interface I want to work with and restart dbus, to 
> NM
> does not handle the connection anymore
> 4) modify interfaces to use a static IP

> All of these are suboptimal, IMHO.

Well, at this point the problem you're describing is not reproducible for
me.

I've set up my ethernet interface as:

  # The primary network interface
  auto eth0
  allow-hotplug eth0
  iface eth0 inet dhcp

I have manually disabled networking with NM.  I have then run
/etc/init.d/networking restart, and the ethernet interface is brought up
successfully, and stays up.

> --------------------------------------------------

> The first situation starts with NM removed, after a reboot, with
> "allow-hotplug" set in interfaces.

> After "networking stop", "networking start" has no effect.
> So this whole issue looks like is related both to NM and the
> "allow-hotplug" vs. "auto" option.

> Sorry for not provifing full information here.

> --------------------------------------------------

So what I understand from this description is that 'allow-hotplug eth0' was
set, and 'auto eth0' was /not/ set, so this behavior of
/etc/init.d/networking is expected.

> Script started on Jo 29 mar 2007 19:57:11 +0300
> debian:/# ifconfig eth0
> eth0      Link encap:Ethernet  HWaddr 52:54:00:12:34:56  
>           inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
>           inet6 addr: fe80::5054:ff:fe12:3456/64 Scope:Link
>           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>           RX packets:9450 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:2313 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:1000 
>           RX bytes:14039029 (13.3 MiB)  TX bytes:149074 (145.5 KiB)
>           Interrupt:10 Base address:0xc100 

> debian:/# ps ax | grep dhc
>  1740 ?        S<s    0:00 dhclient3 -pf /var/run/dhclient.eth0.pid -lf 
> /var/lib/dhcp3/dhclient.eth0.leases eth0
>  8507 pts/2    R+     0:00 grep dhc
> debian:/# /etc/init.d/networking stop
> Deconfiguring network interfaces...There is already a pid file 
> /var/run/dhclient.eth0.pid with pid 1740
> killed old client process, removed PID file
> Internet Systems Consortium DHCP Client V3.0.4
> Copyright 2004-2006 Internet Systems Consortium.
> All rights reserved.
> For info, please visit http://www.isc.org/sw/dhcp/

> Listening on LPF/eth0/52:54:00:12:34:56
> Sending on   LPF/eth0/52:54:00:12:34:56
> Sending on   Socket/fallback
> DHCPRELEASE on eth0 to 10.0.2.2 port 67
> done.
> debian:/# ps ax | grep dhc
>  8540 pts/2    S+     0:00 grep dhc
> debian:/# ifconfig eth0
> eth0      Link encap:Ethernet  HWaddr 52:54:00:12:34:56  
>           BROADCAST MULTICAST  MTU:1500  Metric:1
>           RX packets:9451 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:2315 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:1000 
>           RX bytes:14039089 (13.3 MiB)  TX bytes:149476 (145.9 KiB)
>           Interrupt:10 Base address:0xc100 

> debian:/# /etc/init.d/networking start
> Configuring network interfaces...done.
> debian:/# ifconfig eth0
> eth0      Link encap:Ethernet  HWaddr 52:54:00:12:34:56  
>           BROADCAST MULTICAST  MTU:1500  Metric:1
>           RX packets:9451 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:2315 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:1000 
>           RX bytes:14039089 (13.3 MiB)  TX bytes:149476 (145.9 KiB)
>           Interrupt:10 Base address:0xc100 

> debian:/# /etc/init.d/networking restart
> Reconfiguring network interfaces...done.
> debian:/# ifconfig eth0
> eth0      Link encap:Ethernet  HWaddr 52:54:00:12:34:56  
>           BROADCAST MULTICAST  MTU:1500  Metric:1
>           RX packets:9451 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:2315 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:1000 
>           RX bytes:14039089 (13.3 MiB)  TX bytes:149476 (145.9 KiB)
>           Interrupt:10 Base address:0xc100 

This is all consistent with the ifupdown documentation.
/etc/init.d/networking uses "ifup -a" and "ifdown -a"; when "ifdown -a" is
called it affects *all* interfaces, when "ifup -a" is called it affects
*only* those interfaces that are marked 'auto'.  Yes, this is asymmetrical,
but it's asymmetrical for a reason.

> --------------------------------------------------
> This test starts without NM installed and with "auto eth0" in interfaces.
> In this case the init script behaves as expected, stop is stop, start is
> start, restart is restart.
> --------------------------------------------------

Right, again as expected.

> --------------------------------------------------
> As soon as NM enters the stage, things become weird, even if auto is kept:

> The interface is down, (init) start has no effect until the interface is 
> stopped
> through the init script.

> (this continues the test above)

> --------------------------------------------------

> debian:/# # I will try to install NM, too
> debian:/# aptitude install network-manager
> [...]
> Reloading system message bus config...done.
> Restarting network connection manager: NetworkManager.
> Restarting network events dispatcher: NetworkManagerDispatcher.

> debian:/# ifconfig 
> eth0      Link encap:Ethernet  HWaddr 52:54:00:12:34:56  
>           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>           RX packets:9962 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:2574 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:1000 
>           RX bytes:14764962 (14.0 MiB)  TX bytes:173001 (168.9 KiB)
>           Interrupt:10 Base address:0xc100 

> lo        Link encap:Local Loopback  
>           inet addr:127.0.0.1  Mask:255.0.0.0
>           inet6 addr: ::1/128 Scope:Host
>           UP LOOPBACK RUNNING  MTU:16436  Metric:1
>           RX packets:8 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:0 
>           RX bytes:560 (560.0 b)  TX bytes:560 (560.0 b)

> debian:/# /etc/init.d/networking start
> Configuring network interfaces...done.
> debian:/# ifconfig
> eth0      Link encap:Ethernet  HWaddr 52:54:00:12:34:56  
>           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>           RX packets:9962 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:2574 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:1000 
>           RX bytes:14764962 (14.0 MiB)  TX bytes:173001 (168.9 KiB)
>           Interrupt:10 Base address:0xc100 

> lo        Link encap:Local Loopback  
>           inet addr:127.0.0.1  Mask:255.0.0.0
>           inet6 addr: ::1/128 Scope:Host
>           UP LOOPBACK RUNNING  MTU:16436  Metric:1
>           RX packets:8 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:0 
>           RX bytes:560 (560.0 b)  TX bytes:560 (560.0 b)

> debian:/# /etc/init.d/networking stop
> Deconfiguring network interfaces...There is already a pid file 
> /var/run/dhclient.eth0.pid with pid 8818
> killed old client process, removed PID file
> Internet Systems Consortium DHCP Client V3.0.4
> Copyright 2004-2006 Internet Systems Consortium.
> All rights reserved.
> For info, please visit http://www.isc.org/sw/dhcp/

> Listening on LPF/eth0/52:54:00:12:34:56
> Sending on   LPF/eth0/52:54:00:12:34:56
> Sending on   Socket/fallback
> DHCPRELEASE on eth0 to 10.0.2.2 port 67
> send_packet: Network is unreachable
> send_packet: please consult README file regarding broadcast address.
> done.
> debian:/# ifconfig
> lo        Link encap:Local Loopback  
>           inet addr:127.0.0.1  Mask:255.0.0.0
>           inet6 addr: ::1/128 Scope:Host
>           UP LOOPBACK RUNNING  MTU:16436  Metric:1
>           RX packets:8 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:0 
>           RX bytes:560 (560.0 b)  TX bytes:560 (560.0 b)

> debian:/# /etc/init.d/networking start
> Configuring network interfaces...Internet Systems Consortium DHCP Client 
> V3.0.4
> Copyright 2004-2006 Internet Systems Consortium.
> All rights reserved.
> For info, please visit http://www.isc.org/sw/dhcp/

> Listening on LPF/eth0/52:54:00:12:34:56
> Sending on   LPF/eth0/52:54:00:12:34:56
> Sending on   Socket/fallback
> DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 7
> DHCPOFFER from 10.0.2.2
> DHCPREQUEST on eth0 to 255.255.255.255 port 67
> DHCPACK from 10.0.2.2
> bound to 10.0.2.15 -- renewal in 38286 seconds.
> done.
> debian:/# ifconfig
> eth0      Link encap:Ethernet  HWaddr 52:54:00:12:34:56  
>           inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
>           inet6 addr: fe80::5054:ff:fe12:3456/64 Scope:Link
>           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>           RX packets:9969 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:2592 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:1000 
>           RX bytes:14766597 (14.0 MiB)  TX bytes:176081 (171.9 KiB)
>           Interrupt:10 Base address:0xc100 
> 
> lo        Link encap:Local Loopback  
>           inet addr:127.0.0.1  Mask:255.0.0.0
>           inet6 addr: ::1/128 Scope:Host
>           UP LOOPBACK RUNNING  MTU:16436  Metric:1
>           RX packets:8 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:0 
>           RX bytes:560 (560.0 b)  TX bytes:560 (560.0 b)
> 
> debian:/# exit

> Script done on Jo 29 mar 2007 20:34:09 +0300

Ok, looks perfectly consistent to me -- you install network-manager, it
takes control of the interface; /etc/init.d/networking doesn't bring it up
because network-manager didn't bring the interface *down* using ifupdown, so
ifup believes the interface is already configured (this is the same thing
that happens if you run 'ifconfig eth0 down'); running stop and then start
again resets this.

> --------------------------------------------------
> NM installed, connection was activated the GNOME applet, the interface has
> "allow-hotplug"
> /etc/init.d/networking stop has no effect.
> This configuration would be the one after the default install, *after* the
> user realises that he has to start the interface via the applet.
> --------------------------------------------------

Ah, again, in this case the eth1 interface was not brought up by ifupdown,
but by network-manager; so there's no ifupdown state in
/etc/network/run/ifstate telling ifdown that it needs to act on this
interface.  I agree that this is surprising; perhaps network-manager could
be fixed to write to /etc/network/run/ifstate for better integration?

Cheers,
-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
[EMAIL PROTECTED]                                   http://www.debian.org/

Reply via email to