FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 06-07-2011, 09:55 AM
Brian
 
Default laptop restart eth0 automatically on plugin or on awake like a desktop

On Tue 07 Jun 2011 at 00:10:48 -0400, Mitchell Laks wrote:

> I have a stanza in the /etc/network/interfaces that configures the eth0.

Seeing /etc/network/interfaces wouldn't do any harm.

> This is on laptops I try that I have this problem.

You're not running Network Manager on the laptop?


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20110607095514.GC19914@desktop">http://lists.debian.org/20110607095514.GC19914@desktop
 
Old 06-08-2011, 03:09 PM
Brian
 
Default laptop restart eth0 automatically on plugin or on awake like a desktop

On Tue 07 Jun 2011 at 19:03:28 -0400, Mitchell Laks wrote:

> http://www.debian.org/doc/manuals/reference/ch05.en.html#list-of-stanzas-in-eni
>
> refers to man 5 interfaces which doesn't seem to explain what software
> is doing the work after the plugin of the ethernet cord... and only
> if auto and not allow-hotplug eth0

I strongly suspect neither the auto nor the allow-hotplug line have
anything to do with your problem. In fact, I cannot see how they could
have any bearing on it. auto eth0 simply allows eth0 to be brought up by
ifup -a whereas allow-hotplug eth0 doesn't.

Let's guess your eth0 stanza in /e/n/i uses dhcp. (A static address
configuration would work immediately the network cable was plugged in).
dhclient is going to have a rough time getting an IP address but the
interface will be brought up without one - as ifconfig will confirm.

Plugging the cable back in at this stage doesn't really cause anything
to happen because dhclient is still on the job (please see the timeout
and retry statements in the dhclient.conf manual) and eventually picks
up an address within 5 minutes. So, if you had been patient . . . .


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20110608150941.GH19914@desktop">http://lists.debian.org/20110608150941.GH19914@desktop
 
Old 06-08-2011, 04:06 PM
Camaleón
 
Default laptop restart eth0 automatically on plugin or on awake like a desktop

On Wed, 08 Jun 2011 16:09:41 +0100, Brian wrote:

> On Tue 07 Jun 2011 at 19:03:28 -0400, Mitchell Laks wrote:
>
>> http://www.debian.org/doc/manuals/reference/ch05.en.html#list-of-
stanzas-in-eni
>>
>> refers to man 5 interfaces which doesn't seem to explain what software
>> is doing the work after the plugin of the ethernet cord... and only if
>> auto and not allow-hotplug eth0
>
> I strongly suspect neither the auto nor the allow-hotplug line have
> anything to do with your problem. In fact, I cannot see how they could
> have any bearing on it. auto eth0 simply allows eth0 to be brought up by
> ifup -a whereas allow-hotplug eth0 doesn't.

(...)

It seems it can fail, at least under some scenarios ;-)

ifupdown: /etc/init.d/networking should support allow-hotplug
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=550014

If you add to this udev events and system restoration from a suspended
state, the mess can be royal.

There must be another similiar bugs out there because this is not the
first time I've read problems with the "*-hotplug" stanza.

Greetings,

--
Camaleón


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: pan.2011.06.08.16.06.34@gmail.com">http://lists.debian.org/pan.2011.06.08.16.06.34@gmail.com
 
Old 06-08-2011, 05:27 PM
Brian
 
Default laptop restart eth0 automatically on plugin or on awake like a desktop

On Wed 08 Jun 2011 at 16:06:34 +0000, Camaleón wrote:

> It seems it can fail, at least under some scenarios ;-)
>
> ifupdown: /etc/init.d/networking should support allow-hotplug
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=550014

This isn't a failure of allow-hotplug but a perceived defect in the
/etc/init.d/networking script, which only takes account of auto.

> If you add to this udev events and system restoration from a suspended
> state, the mess can be royal.

Not a problem the OP experienced.

> There must be another similiar bugs out there because this is not the
> first time I've read problems with the "*-hotplug" stanza.

You have the advantage on me but I'm unpersuaded. The initial post was a
classic dhcp couldn't get an address description. Now if he had said he
was using static addressing (which just may be on the desktop machines
he mentioned) I'd be stumped.

Maybe Mitchell Laks could boot with allow-hotplug and with auto 20/30
times and report his observations. And another 20/30 times without
either. Recording relevant boot messages of course and seeing what dmesg
has to say about the state of eth0.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20110608172744.GI19914@desktop">http://lists.debian.org/20110608172744.GI19914@desktop
 
Old 06-08-2011, 07:02 PM
Camaleón
 
Default laptop restart eth0 automatically on plugin or on awake like a desktop

On Wed, 08 Jun 2011 18:27:44 +0100, Brian wrote:

> On Wed 08 Jun 2011 at 16:06:34 +0000, Camaleón wrote:
>
>> It seems it can fail, at least under some scenarios ;-)
>>
>> ifupdown: /etc/init.d/networking should support allow-hotplug
>> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=550014
>
> This isn't a failure of allow-hotplug but a perceived defect in the
> /etc/init.d/networking script, which only takes account of auto.

Yep, and that's unfortunate if whatever routine (udev rule or event,
dhcpcd-client, suspension restore script...) tries to wake up the network
service.

>> If you add to this udev events and system restoration from a suspended
>> state, the mess can be royal.
>
> Not a problem the OP experienced.

I can't tell for sure, but many users are experincing the same problem,
and not only from Debian but also from Ubuntu and Mint, so...
casualty? :-)

>> There must be another similiar bugs out there because this is not the
>> first time I've read problems with the "*-hotplug" stanza.
>
> You have the advantage on me but I'm unpersuaded. The initial post was a
> classic dhcp couldn't get an address description. Now if he had said he
> was using static addressing (which just may be on the desktop machines
> he mentioned) I'd be stumped.

Hum... I don't rebember nothing about dhcp or static addressing but
something about plugging/unplugging the ethernet cable and after that no
interface coming up.

> Maybe Mitchell Laks could boot with allow-hotplug and with auto 20/30
> times and report his observations. And another 20/30 times without
> either. Recording relevant boot messages of course and seeing what dmesg
> has to say about the state of eth0.

Sure :-)

Greetings,

--
Camaleón


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: pan.2011.06.08.19.02.43@gmail.com">http://lists.debian.org/pan.2011.06.08.19.02.43@gmail.com
 
Old 06-09-2011, 04:48 PM
Brian
 
Default laptop restart eth0 automatically on plugin or on awake like a desktop

On Wed 08 Jun 2011 at 19:02:43 +0000, Camaleón wrote:

> I can't tell for sure, but many users are experincing the same problem,
> and not only from Debian but also from Ubuntu and Mint, so...
> casualty? :-)

I'm always more comfortable with specifics.

> Hum... I don't rebember nothing about dhcp or static addressing but
> something about plugging/unplugging the ethernet cable and after that no
> interface coming up.

Why would plugging or unplugging the ethernet cable be expected to
bring the interface up or down? The kernel knows what's going on but,
apart from reporting the link is ready or not, does nothing about it.
As for udev - it produces no event when the state of the cable
connection changes.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20110609164800.GN19914@desktop">http://lists.debian.org/20110609164800.GN19914@desktop
 
Old 06-09-2011, 05:55 PM
Camaleón
 
Default laptop restart eth0 automatically on plugin or on awake like a desktop

On Thu, 09 Jun 2011 17:48:00 +0100, Brian wrote:

> On Wed 08 Jun 2011 at 19:02:43 +0000, Camaleón wrote:
>
>> I can't tell for sure, but many users are experincing the same problem,
>> and not only from Debian but also from Ubuntu and Mint, so... casualty?
>> :-)
>
> I'm always more comfortable with specifics.

I think that could have been debugged more easily years ago when all was
static (file configuration based) but now with udev events and all that
"dynamicallities" it can be more complicated.

>> Hum... I don't rebember nothing about dhcp or static addressing but
>> something about plugging/unplugging the ethernet cable and after that
>> no interface coming up.
>
> Why would plugging or unplugging the ethernet cable be expected to bring
> the interface up or down? The kernel knows what's going on but, apart
> from reporting the link is ready or not, does nothing about it. As for
> udev - it produces no event when the state of the cable connection
> changes.

Hum... what happens when you attach a USB device to the computer? Kernel
detects it and DE mounts it based on user's settings. And what happens
when you dettach the key? Kernel (or udev, or both) remove/umount the
device.

I would have thought that something similar happens with an ethernet
device but I've lost the track to udev development and currently I would
not put my hand in the fire for what and how it does.

Greetings,

--
Camaleón


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: pan.2011.06.09.17.55.50@gmail.com">http://lists.debian.org/pan.2011.06.09.17.55.50@gmail.com
 
Old 06-09-2011, 06:35 PM
Brian
 
Default laptop restart eth0 automatically on plugin or on awake like a desktop

On Thu 09 Jun 2011 at 17:55:50 +0000, Camaleón wrote:

> Hum... what happens when you attach a USB device to the computer? Kernel
> detects it and DE mounts it based on user's settings. And what happens
> when you dettach the key? Kernel (or udev, or both) remove/umount the
> device.

You are talking about *devices* here.

> I would have thought that something similar happens with an ethernet
> device but I've lost the track to udev development and currently I would
> not put my hand in the fire for what and how it does.

An ethernet cable is not a device.

But I like your turn of phrase. Go on, get your fingers burnt! udevadm(8)
and unplug and plug the cable back in. See any reaction from udev?

The question remains - Why would plugging or unplugging the ethernet
cable be expected to bring the interface up or down?


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20110609183548.GO19914@desktop">http://lists.debian.org/20110609183548.GO19914@desktop
 
Old 06-09-2011, 07:11 PM
Camaleón
 
Default laptop restart eth0 automatically on plugin or on awake like a desktop

On Thu, 09 Jun 2011 19:35:48 +0100, Brian wrote:

> On Thu 09 Jun 2011 at 17:55:50 +0000, Camaleón wrote:
>
>> Hum... what happens when you attach a USB device to the computer?
>> Kernel detects it and DE mounts it based on user's settings. And what
>> happens when you dettach the key? Kernel (or udev, or both)
>> remove/umount the device.
>
> You are talking about *devices* here.

AFAIK, network devices (NICs) are also managed by udev.

Under lenny I have set a couple of rules for them:

sm01@stt008:~$ ls -l /etc/udev/rules.d | grep net
-rw-r--r-- 1 root root 955 nov 14 2009 70-persistent-net.rules
-rw-r--r-- 1 root root 4427 ago 26 2009 75-persistent-net-generator.rules

>> I would have thought that something similar happens with an ethernet
>> device but I've lost the track to udev development and currently I
>> would not put my hand in the fire for what and how it does.
>
> An ethernet cable is not a device.

But the card is and the card interacts with it in some way when the cable is on/
off :-P

> But I like your turn of phrase. Go on, get your fingers burnt!
> udevadm(8) and unplug and plug the cable back in. See any reaction from
> udev?

Me? I don't have any problem with "*-hotplug".

> The question remains - Why would plugging or unplugging the ethernet
> cable be expected to bring the interface up or down?

It does not have to be an isolated event.

For example, the computer is hibernated or suspended, the cable was
disonnected, you attach it and then you awake the system that triggers
the restore script for the network service and the interface that was
marked with "allow-hotplug" cannot be up.

There can be another scenarios.

Greetings,

--
Camaleón


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: pan.2011.06.09.19.11.48@gmail.com">http://lists.debian.org/pan.2011.06.09.19.11.48@gmail.com
 
Old 06-09-2011, 08:07 PM
Dom
 
Default laptop restart eth0 automatically on plugin or on awake like a desktop

On 09/06/11 19:35, Brian wrote:

On Thu 09 Jun 2011 at 17:55:50 +0000, Camaleón wrote:


Hum... what happens when you attach a USB device to the computer? Kernel
detects it and DE mounts it based on user's settings. And what happens
when you dettach the key? Kernel (or udev, or both) remove/umount the
device.


You are talking about *devices* here.


I would have thought that something similar happens with an ethernet
device but I've lost the track to udev development and currently I would
not put my hand in the fire for what and how it does.


An ethernet cable is not a device.

But I like your turn of phrase. Go on, get your fingers burnt! udevadm(8)
and unplug and plug the cable back in. See any reaction from udev?

The question remains - Why would plugging or unplugging the ethernet
cable be expected to bring the interface up or down?


This sounds like a job for ifplugd

"ifplugd is a daemon which will automatically configure your ethernet
device when a cable is plugged in and automatically de-configure it if
the cable is pulled out. This is useful on laptops with onboard network
adapters, since it will only configure the interface when a cable is
really connected."


Caveat: I've not used ifplugd myself, I have a couple of custom scripts
that do various things depending on which interface (Wired/Wireless) is
available.

--
Dom


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Archive: 4DF127EB.20408@rpdom.net">http://lists.debian.org/4DF127EB.20408@rpdom.net
 

Thread Tools




All times are GMT. The time now is 01:23 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org