Re: Two identical usb networking cards problem

2007-03-03 Thread Kevin Mark
On Sat, Mar 03, 2007 at 05:27:04PM +0100, David Fokkema wrote:
> On Sat, 2007-03-03 at 16:13 +, Wackojacko wrote:
> > David Fokkema wrote:
> > > On Sat, 2007-03-03 at 15:37 +, Wackojacko wrote:
> > >> David Fokkema wrote:
> > >>
> > >>> Still leaves me with one question: how do I figure out which
> > >>> daemon/script brings up my interfaces at what time?
> > >>>
> > >>> Thanks,
> > >>>
> > >>> David
> > >>>
> > >>>
> > >> /etc/init.d/networking is the script.  The order of the scripts is 
> > >> controlled by the order in which they appear in the relevant run level 
> > >> directory /etc/rc(runlevel).d.
> > >>
> > >> The SXXscript 'starts' the script KXXscript stops it.  These links are 
> > >> run in numerical order of the XX.
> > > 
> > > This script only runs 'ifup -a', as far as I can tell. Ifup won't log
> > > which devices it upped. Furthermore, 'ifup -a' never ups my usb nets
> > > eth1 and eth2 when I ssh in, down eth1 and eth2 and then issue 'ifup
> > > -a'. However, one of them is always up when my system finishes booting.
> > > How can that be?
> > > 
> > >
> > Hmm!
> > 
> > from man ifup
> > 
> > '-a, --all  If given to ifup, affect all interfaces marked auto.
> >  
> > Interfaces are brought up in the order in which they are  defined in 
> >/etc/network/interfaces.'
> > 
> > man interfaces
> > 
> > 'Lines beginning with the word "auto" are used to identify the physical 
> > interfaces to be brought up when ifup is run  with  the  -a option. 
> > (This  option  is  used by the system boot scripts.)  Physical interface 
> > names should follow the word "auto" on the same line.  There can be 
> > multiple "auto" stanzas.  ifup brings the named interfaces up in the 
> > order listed.
> > 
> > Lines beginning with "allow-" are used to identify interfaces that 
> > should be brought up automatically by various  subsytems.  This may  be 
> > done using a command such as "ifup --allow=hotplug eth0 eth1", which 
> > will only bring up eth0 or eth1 if it is listed in an "allow-hotplug" 
> > line. Note that "allow-auto" and "auto" are synonyms.'
> > 
> > So ifup -a will only bring up all the interfaces marked 'auto' as you 
> > have discovered.
> > 
> > allow-hotplug passes the task of bringing up of the interface to udev 
> > (as this now incorporates hotplug) so /etc/init.d/udev is the script 
> > that starts the deamon.
> > 
> > As to why this doesn't work and the 'auto' does, its probably something 
> > to do with the udev rules used to identify the interfaces.  I don't have 
> > usb interfaces and am not a udev expert so I don't know how much more 
> > help I can be :)
> 
> I have the same feeling. Reading through the documentation I believe I
> get a feeling for how it works, but looking through the logs (there
> _are_ udev logs and I modified net.agent to log the interface it is
> operating on) no devices are brought up by udev (unless I yank it out
> and insert it again in my usb hub). So... what happens? It is irritating
> to discover that linux does not log everything (as I always tell windows
> users who're tracking down fathomable problems).
> 
I have a vague impression that this may be related to the initrd. the
kernel boots with the initrd and has script that do things like modprobe
things related to say networking device then init is called and the
runlevels do their thing. IIRC the initrd stuff is not logged, so that
would explain why there is not messages and since this happends before
the runlevels, you cant change the outcome. This is a bit of wild
speculation as this is a fuzzy area in my understanding. Any further
clarifictions welcomed. Udev always seems to be voodoo to use mortals.
-- 
|  .''`.  == Debian GNU/Linux == |   my web site:   |
| : :' :  The  Universal |mysite.verizon.net/kevin.mark/|
| `. `'  Operating System| go to counter.li.org and |
|   `-http://www.debian.org/ |be counted! #238656   |
|  my keyserver: subkeys.pgp.net | my NPO: cfsg.org |


signature.asc
Description: Digital signature


Re: Two identical usb networking cards problem

2007-03-03 Thread David Fokkema
On Sat, 2007-03-03 at 18:02 +0100, Franck Joncourt wrote:
> On Sat, Mar 03, 2007 at 04:34:37PM +, Wackojacko wrote:
> > David Fokkema wrote:
> > >It is irritating
> > >to discover that linux does not log everything (as I always tell windows
> > >users who're tracking down fathomable problems).
> > >
> > >David
> > >
> > >
> > Just had a quick look at /etc/udev/ and it may be worth uncommenting the 
> > log lines in some or all of the files here.
> > 
> > e.g. the last line of hotplug.rules has an additional logging function, 
> > it may help you track down what happens when you insert the device which 
> > is not happening on boot?

That's helpful! I edited udev.conf to enable logging, but this might
even be better! I'll try that, thanks!

> Maybe you can try with the following rule, if the above
> solution does not work :
> 
> SUBSYSTEM=="net", ACTION=="add", RUN+="/bin/sh -c 'echo FOUND NETWORK 
> INTERFACE %k >/dev/console'"
> 
> I did not test it :p! But it might help.

Nice! If the above does not work, I'll try this one, thanks!

David


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: Two identical usb networking cards problem

2007-03-03 Thread Franck Joncourt
On Sat, Mar 03, 2007 at 04:34:37PM +, Wackojacko wrote:
> David Fokkema wrote:
> >It is irritating
> >to discover that linux does not log everything (as I always tell windows
> >users who're tracking down fathomable problems).
> >
> >David
> >
> >
> Just had a quick look at /etc/udev/ and it may be worth uncommenting the 
> log lines in some or all of the files here.
> 
> e.g. the last line of hotplug.rules has an additional logging function, 
> it may help you track down what happens when you insert the device which 
> is not happening on boot?
> 

Maybe you can try with the following rule, if the above
solution does not work :

SUBSYSTEM=="net", ACTION=="add", RUN+="/bin/sh -c 'echo FOUND NETWORK 
INTERFACE %k >/dev/console'"

I did not test it :p! But it might help.

-- 
Franck Joncourt
http://www.debian.org
http://smhteam.info/wiki/
GPG server : pgpkeys.mit.edu
Fingerprint : C10E D1D0 EF70 0A2A CACF  9A3C C490 534E 75C0 89FE


signature.asc
Description: Digital signature


Re: Two identical usb networking cards problem

2007-03-03 Thread Wackojacko

David Fokkema wrote:

It is irritating
to discover that linux does not log everything (as I always tell windows
users who're tracking down fathomable problems).

David


Just had a quick look at /etc/udev/ and it may be worth uncommenting the 
log lines in some or all of the files here.


e.g. the last line of hotplug.rules has an additional logging function, 
it may help you track down what happens when you insert the device which 
is not happening on boot?


HTH

Wackojacko


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]




Re: Two identical usb networking cards problem

2007-03-03 Thread David Fokkema
On Sat, 2007-03-03 at 16:13 +, Wackojacko wrote:
> David Fokkema wrote:
> > On Sat, 2007-03-03 at 15:37 +, Wackojacko wrote:
> >> David Fokkema wrote:
> >>
> >>> Still leaves me with one question: how do I figure out which
> >>> daemon/script brings up my interfaces at what time?
> >>>
> >>> Thanks,
> >>>
> >>> David
> >>>
> >>>
> >> /etc/init.d/networking is the script.  The order of the scripts is 
> >> controlled by the order in which they appear in the relevant run level 
> >> directory /etc/rc(runlevel).d.
> >>
> >> The SXXscript 'starts' the script KXXscript stops it.  These links are 
> >> run in numerical order of the XX.
> > 
> > This script only runs 'ifup -a', as far as I can tell. Ifup won't log
> > which devices it upped. Furthermore, 'ifup -a' never ups my usb nets
> > eth1 and eth2 when I ssh in, down eth1 and eth2 and then issue 'ifup
> > -a'. However, one of them is always up when my system finishes booting.
> > How can that be?
> > 
> >
> Hmm!
> 
> from man ifup
> 
> '-a, --all  If given to ifup, affect all interfaces marked auto.  
>  
> Interfaces are brought up in the order in which they are  defined in 
>/etc/network/interfaces.'
> 
> man interfaces
> 
> 'Lines beginning with the word "auto" are used to identify the physical 
> interfaces to be brought up when ifup is run  with  the  -a option. 
> (This  option  is  used by the system boot scripts.)  Physical interface 
> names should follow the word "auto" on the same line.  There can be 
> multiple "auto" stanzas.  ifup brings the named interfaces up in the 
> order listed.
> 
> Lines beginning with "allow-" are used to identify interfaces that 
> should be brought up automatically by various  subsytems.  This may  be 
> done using a command such as "ifup --allow=hotplug eth0 eth1", which 
> will only bring up eth0 or eth1 if it is listed in an "allow-hotplug" 
> line. Note that "allow-auto" and "auto" are synonyms.'
> 
> So ifup -a will only bring up all the interfaces marked 'auto' as you 
> have discovered.
> 
> allow-hotplug passes the task of bringing up of the interface to udev 
> (as this now incorporates hotplug) so /etc/init.d/udev is the script 
> that starts the deamon.
> 
> As to why this doesn't work and the 'auto' does, its probably something 
> to do with the udev rules used to identify the interfaces.  I don't have 
> usb interfaces and am not a udev expert so I don't know how much more 
> help I can be :)

I have the same feeling. Reading through the documentation I believe I
get a feeling for how it works, but looking through the logs (there
_are_ udev logs and I modified net.agent to log the interface it is
operating on) no devices are brought up by udev (unless I yank it out
and insert it again in my usb hub). So... what happens? It is irritating
to discover that linux does not log everything (as I always tell windows
users who're tracking down fathomable problems).

> Regards
> 
> Wackojacko

Thanks!

David


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: Two identical usb networking cards problem

2007-03-03 Thread Wackojacko

David Fokkema wrote:

On Sat, 2007-03-03 at 15:37 +, Wackojacko wrote:

David Fokkema wrote:


Still leaves me with one question: how do I figure out which
daemon/script brings up my interfaces at what time?

Thanks,

David


/etc/init.d/networking is the script.  The order of the scripts is 
controlled by the order in which they appear in the relevant run level 
directory /etc/rc(runlevel).d.


The SXXscript 'starts' the script KXXscript stops it.  These links are 
run in numerical order of the XX.


This script only runs 'ifup -a', as far as I can tell. Ifup won't log
which devices it upped. Furthermore, 'ifup -a' never ups my usb nets
eth1 and eth2 when I ssh in, down eth1 and eth2 and then issue 'ifup
-a'. However, one of them is always up when my system finishes booting.
How can that be?



Hmm!

from man ifup

'-a, --all  If given to ifup, affect all interfaces marked auto.  	 
Interfaces are brought up in the order in which they are  defined in 
  /etc/network/interfaces.'


man interfaces

'Lines beginning with the word "auto" are used to identify the physical 
interfaces to be brought up when ifup is run  with  the  -a option. 
(This  option  is  used by the system boot scripts.)  Physical interface 
names should follow the word "auto" on the same line.  There can be 
multiple "auto" stanzas.  ifup brings the named interfaces up in the 
order listed.


Lines beginning with "allow-" are used to identify interfaces that 
should be brought up automatically by various  subsytems.  This may  be 
done using a command such as "ifup --allow=hotplug eth0 eth1", which 
will only bring up eth0 or eth1 if it is listed in an "allow-hotplug" 
line. Note that "allow-auto" and "auto" are synonyms.'


So ifup -a will only bring up all the interfaces marked 'auto' as you 
have discovered.


allow-hotplug passes the task of bringing up of the interface to udev 
(as this now incorporates hotplug) so /etc/init.d/udev is the script 
that starts the deamon.


As to why this doesn't work and the 'auto' does, its probably something 
to do with the udev rules used to identify the interfaces.  I don't have 
usb interfaces and am not a udev expert so I don't know how much more 
help I can be :)


Regards

Wackojacko



--
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]




Re: Two identical usb networking cards problem

2007-03-03 Thread David Fokkema
On Sat, 2007-03-03 at 15:37 +, Wackojacko wrote:
> David Fokkema wrote:
> 
> > 
> > Still leaves me with one question: how do I figure out which
> > daemon/script brings up my interfaces at what time?
> > 
> > Thanks,
> > 
> > David
> > 
> > 
> /etc/init.d/networking is the script.  The order of the scripts is 
> controlled by the order in which they appear in the relevant run level 
> directory /etc/rc(runlevel).d.
> 
> The SXXscript 'starts' the script KXXscript stops it.  These links are 
> run in numerical order of the XX.

This script only runs 'ifup -a', as far as I can tell. Ifup won't log
which devices it upped. Furthermore, 'ifup -a' never ups my usb nets
eth1 and eth2 when I ssh in, down eth1 and eth2 and then issue 'ifup
-a'. However, one of them is always up when my system finishes booting.
How can that be?

David

> 
> HTH
> 
> Wackojacko
> 
> 


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: Two identical usb networking cards problem

2007-03-03 Thread Wackojacko

David Fokkema wrote:



Still leaves me with one question: how do I figure out which
daemon/script brings up my interfaces at what time?

Thanks,

David


/etc/init.d/networking is the script.  The order of the scripts is 
controlled by the order in which they appear in the relevant run level 
directory /etc/rc(runlevel).d.


The SXXscript 'starts' the script KXXscript stops it.  These links are 
run in numerical order of the XX.


HTH

Wackojacko


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]




Re: Two identical usb networking cards problem

2007-03-03 Thread David Fokkema
On Sat, 2007-03-03 at 14:54 +0100, Franck Joncourt wrote:
> On Sat, Mar 03, 2007 at 02:19:20PM +0100, David Fokkema wrote:
> > Hi group,
>  
> Hi,
> 

> 
> Take a look here :
> 
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=403706

Thanks! That was insightful.

> The following commands are your friends :
> # ip link
> or 
> # ifconfig -a

I fail to see what the former can tell me other than what netstat -ie
can, for example...

> If you can see an interface names as ethX_rename or something like that,
> it means udev mess it up. You can fix it, by writing udev rules. This is
> the way I do to ensure my interfaces get the right name.

Nope, everythings ok there.

> By the way, you can see the name supply by udev :
> 
> <<<
> sid:/var/lib# cat /etc/udev/rules.d/z25_persistent-net.rules
> # This file was automatically generated by the /lib/udev/write_net_rules
> # program, probably run by the persistent-net-generator.rules rules
> # file.
> #
> # You can modify it, as long as you keep each rule on a single line.
> 
> # Firewire device 0011d8b05f6c (ohci1394)
> SUBSYSTEM=="net", DRIVERS=="?*",
> ATTRS{address}=="00:11:d8:00:00:b0:5f:6c", NAME="eth0"
> 
> # PCI device 0x10de:0x0373 (forcedeth)
> #SUBSYSTEM=="net", DRIVERS=="?*", ATTRS{address}=="00:17:31:a4:0b:4e",
> NAME="eth1"
> 
> # PCI device 0x10de:0x0373 (forcedeth)
> #SUBSYSTEM=="net", DRIVERS=="?*", ATTRS{address}=="00:17:31:a3:ff:31",
> NAME="eth2"
> 
> # PCI device 0x1113:0x1211 (8139too)
> #SUBSYSTEM=="net", DRIVERS=="?*", ATTRS{address}=="00:10:b5:e1:5c:e5",
> NAME="eth3"
> 
> # PCI device 0x10ec:0x8139 (8139too)
> #SUBSYSTEM=="net", DRIVERS=="?*", ATTRS{address}=="00:08:a1:96:82:35",
> NAME="eth4"
> <

Yes, I have a similar file.


> 
> Hope it helps.
> 

It does, thank you. I will add 'auto' lines next to the 'allow-hotplug'
lines in my config.

Still leaves me with one question: how do I figure out which
daemon/script brings up my interfaces at what time?

Thanks,

David


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: Two identical usb networking cards problem

2007-03-03 Thread Franck Joncourt
On Sat, Mar 03, 2007 at 02:19:20PM +0100, David Fokkema wrote:
> Hi group,
 
Hi,

> I installed debian etch on an NSLU2. It has an internal network card
> which is brought up automatically at boot time. I have two additional
> usb network cards attached to a hub which are identical. Only one of
> them is brought up at boot time. Which one, that is (well, seems to be,
> anyway) completely random, :-/
> 
> My /etc/network/interfaces:
> # This file describes the network interfaces available on your system
> # and how to activate them. For more information, see interfaces(5).
> 
> # The loopback network interface
> auto lo
> iface lo inet loopback
> 
> # The primary network interface
> allow-hotplug eth0
> iface eth0 inet static
> address 192.168.20.10
> netmask 255.255.255.0
> 
> allow-hotplug eth1
> iface eth1 inet static
> address 192.168.31.10
> netmask 255.255.255.0
> 
> allow-hotplug eth2
> iface eth2 inet dhcp
> pre-up ethtool -s eth2 autoneg off speed 10
> 
> 
> If I change the allow-hotplug to auto, my problem is solved. 

> My question: how can I find out which daemon/script is bringing up my
> two out of three interfaces and how can I make sure it brings up all
> three (without resorting to auto lines, apparently allow-hotplug
> should
> work).
>


Take a look here :

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=403706

The following commands are your friends :
# ip link
or 
# ifconfig -a

If you can see an interface names as ethX_rename or something like that,
it means udev mess it up. You can fix it, by writing udev rules. This is
the way I do to ensure my interfaces get the right name.

By the way, you can see the name supply by udev :

<<<
sid:/var/lib# cat /etc/udev/rules.d/z25_persistent-net.rules
# This file was automatically generated by the /lib/udev/write_net_rules
# program, probably run by the persistent-net-generator.rules rules
# file.
#
# You can modify it, as long as you keep each rule on a single line.

# Firewire device 0011d8b05f6c (ohci1394)
SUBSYSTEM=="net", DRIVERS=="?*",
ATTRS{address}=="00:11:d8:00:00:b0:5f:6c", NAME="eth0"

# PCI device 0x10de:0x0373 (forcedeth)
#SUBSYSTEM=="net", DRIVERS=="?*", ATTRS{address}=="00:17:31:a4:0b:4e",
NAME="eth1"

# PCI device 0x10de:0x0373 (forcedeth)
#SUBSYSTEM=="net", DRIVERS=="?*", ATTRS{address}=="00:17:31:a3:ff:31",
NAME="eth2"

# PCI device 0x1113:0x1211 (8139too)
#SUBSYSTEM=="net", DRIVERS=="?*", ATTRS{address}=="00:10:b5:e1:5c:e5",
NAME="eth3"

# PCI device 0x10ec:0x8139 (8139too)
#SUBSYSTEM=="net", DRIVERS=="?*", ATTRS{address}=="00:08:a1:96:82:35",
NAME="eth4"
<

Hope it helps.

-- 
Franck Joncourt
http://www.debian.org
http://smhteam.info/wiki/
GPG server : pgpkeys.mit.edu
Fingerprint : C10E D1D0 EF70 0A2A CACF  9A3C C490 534E 75C0 89FE


signature.asc
Description: Digital signature


Two identical usb networking cards problem

2007-03-03 Thread David Fokkema
Hi group,

I googled / searched the list around a lot but couldn't find what the
cause of my problem might be...

I installed debian etch on an NSLU2. It has an internal network card
which is brought up automatically at boot time. I have two additional
usb network cards attached to a hub which are identical. Only one of
them is brought up at boot time. Which one, that is (well, seems to be,
anyway) completely random, :-/

My /etc/network/interfaces:
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
iface eth0 inet static
address 192.168.20.10
netmask 255.255.255.0

allow-hotplug eth1
iface eth1 inet static
address 192.168.31.10
netmask 255.255.255.0

allow-hotplug eth2
iface eth2 inet dhcp
pre-up ethtool -s eth2 autoneg off speed 10


If I change the allow-hotplug to auto, my problem is solved. So why this
mail? Just because I feel that etch is logging way to little information
because:

1. I can't seem to find in the logs when and by what daemon / script
eth0 is brought up. It is always brought up. No logs whatsoever.
2. I had to edit /lib/udev/net.agent to let it log which interface it
was bringing up. I already set a log level of debug
in /etc/udev/udev.conf but that is not enough.
3. It seems that udev is not involved, however, it must be udev which is
changing interface names with its persistent-net.rules since my logs
tell me that the asix driver loads eth1 and eth2 with some mac
addresses, but after I bring up the missing interface, the names are
swapped according to their mac addresses. However, I can't seem to find
that in the logs.
4. /var/log/boot tells me ifup -a is run, however, I'd like to know
which interfaces ifup is bringing up. No log...
5. It is not ifup -a which is bringing up the one usb interface because
ifdown eth1 and eth2 and then ifup -a -n shows me ifup has no intention
of bringing up either eth1 or eth2.

My question: how can I find out which daemon/script is bringing up my
two out of three interfaces and how can I make sure it brings up all
three (without resorting to auto lines, apparently allow-hotplug should
work).

I feel kinda lost...

Thanks in advance,

David


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]