Skip to contentSkip to conversation

Manage network links with hotplug?

DISCUSSION Joerg Sommer 4 participants 9 messages Mar 21, 2004 – Mar 26, 2004

lore
Share & tools
lore
#0 lore raw

Hi,

is it possible to manage network links with hotplug. Is there a hotplug event if the cable is pluged in the network card? Is would supersede tools like ifplugd which poll the state of the network link.

Kind regards, Joerg.

Signature · 13 lines
A red sign on the door of a physics professor: 'If this sign is blue, 
you're going too fast.'


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
#1 lore raw
Quoted 3 lines · Joerg Sommer

is it possible to manage network links with hotplug. Is there a hotplug event if the cable is pluged in the network card? Is would supersede tools like ifplugd which poll the state of the network link.

Yes, look at /etc/hotplug/net.agent.
The major problem is that there is no good way to assign an interface name to a specific hardware device (but this happens also without hotplug...).

Signature · 13 lines
ciao, |
Marco | [5218 coqCk7zBwtBZk]


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
#2 lore raw
In reply to Joerg Sommer
Quoted 9 lines · Marco d'Itri
Quoted 3 lines · Joerg Sommer

is it possible to manage network links with hotplug. Is there a hotplug event if the cable is pluged in the network card? Is would supersede tools like ifplugd which poll the state of the network link.

Yes, look at /etc/hotplug/net.agent.
The major problem is that there is no good way to assign an interface name to a specific hardware device (but this happens also without hotplug...).

What is wrong with using nameif for this?

thanks,

greg k-h

-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#3 lore raw
In reply to Joerg Sommer
Quoted 4 lines · Greg KH
Quoted 3 lines

The major problem is that there is no good way to assign an interface name to a specific hardware device (but this happens also without hotplug...).

What is wrong with using nameif for this?

In my experience it just does not work: not all tools recognize the modified names.
(I remember spending an afternoon swearing at it last year, maybe in this time it has been improved? If there are limitations I don't remember seeing them documented.)

Signature · 13 lines
ciao, |
Marco | [5241 scr/B96m1AdpQ]


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
#4 lore raw
In reply to Joerg Sommer
Quoted 8 lines · Marco d'Itri
Quoted 4 lines · Greg KH
Quoted 3 lines

The major problem is that there is no good way to assign an interface name to a specific hardware device (but this happens also without hotplug...).

What is wrong with using nameif for this?

In my experience it just does not work: not all tools recognize the modified names.

In my experience, and in Red Hat's and SuSE's experience, nameif works just fine to bind network adapters to specific MAC address of devices.

As I personally know loads of people using it, and I know of some developers working on adding some udev-like functions to nameif to handle pci device names and stuff, I'm pretty sure this is the proper tool.

thanks,

greg k-h

-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#5 lore raw
In reply to Joerg Sommer
Quoted 6 lines · begin "Marco d'Itri
Quoted 3 lines · Joerg Sommer

is it possible to manage network links with hotplug. Is there a hotplug event if the cable is pluged in the network card? Is would supersede tools like ifplugd which poll the state of the network link.

Yes, look at /etc/hotplug/net.agent.

But I don't get any hotplug event. I set export DEBUG=yes in /sbin/hotplug, pulled out the network cable, waited a few seconds and pluged it in, but I didn't get any message in /var/log/user.log and nothing happend.

BTW: Why does hotplug log with facility user? It isn't an user application. I would prefer daemon.

Jörg.
end.

Signature · 13 lines
Angenehme Worte sind nie wahr,
wahre Worte sind nie angenehm.


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
#6 lore raw
In reply to Joerg Sommer
Quoted 6 lines · Joerg Sommer
Quoted 5 lines · begin "Marco d'Itri
Quoted 3 lines · Joerg Sommer

is it possible to manage network links with hotplug. Is there a hotplug event if the cable is pluged in the network card? Is would supersede tools like ifplugd which poll the state of the network link.

Quoted 6 lines
Quoted 1 line

Yes, look at /etc/hotplug/net.agent.

But I don't get any hotplug event. I set export DEBUG=yes in /sbin/hotplug, pulled out the network cable, waited a few seconds and pluged it in, but I didn't get any message in /var/log/user.log and nothing happend.

Oops, sorry, network cable events do not generate hotplug events. I was thinking of network device adds and removes. You will have to use ethtool or netlink to detect loss of the ethernet link.

Good luck,

greg k-h

-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#7 lore raw
In reply to Joerg Sommer
Quoted 3 lines · Greg KH

Oops, sorry, network cable events do not generate hotplug events. I was thinking of network device adds and removes. You will have to use ethtool or netlink to detect loss of the ethernet link.

Why don't make the net drivers raise an hotplug event instead? this would be a cleaner design...

--
Gioele

-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#8 lore raw
In reply to Joerg Sommer
Quoted 6 lines · Gioele Barabucci
Quoted 3 lines · Greg KH

Oops, sorry, network cable events do not generate hotplug events. I was thinking of network device adds and removes. You will have to use ethtool or netlink to detect loss of the ethernet link.

Why don't make the net drivers raise an hotplug event instead? this would be a cleaner design...

Go talk to the network driver authors :)

Good luck.

greg k-h

-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel