Skip to contentSkip to conversation

net.hotplug and ifup (Mandrake 9.0)

DISCUSSION zephod 2 participants 2 messages Oct 14, 2002

lore
Share & tools
lore

zephod

author
#0 lore raw

Dear all,

I have a setup with 5 network cards and I only start 2 of them at boot time (ON_BOOT=yes/no in the corresponding /etc/sysconfig/network-scripts/ifcfg-eth?). When I upgraded form Mandrake 8.2 to 9.0 the version of hotplug changed from 2002_01_14 to 2002_04_01. One of the differences is the following lines in net.agent (line 30):

# Don't do anything if the network is stopped
if [ ! -f /var/lock/subsys/network ]; then
exit 0
fi

With the removal of this piece of code all network interfaces are brought up by hotplug (using ifup) at boot time. Although I was tempted to reinsert these lines as a quick hack, I dove into the .etc directory to find some answers. After some digging I encountered some lines (47 in /sbin/ifup):

if [ -n "$IN_HOTPLUG" -a "${HOTPLUG}" = "no" -o "${HOTPLUG}" = "NO" ] then
exit 0
fi

So I tried to set a "HOTPLUG=NO" in the interfaces I don't need at boot time. Offcourse now these interfaces are impossible to setup with e.g. ifup eth1. This was not the desired effect. The solution was to add "HOTPLUG=no" (notice the difference) to the corresponding /etc/sysconfig/network-scripts/ifcfg-eth? and add a line to /etc/hotplug/hotplpug.functions (line 21):

export IN_HOTPLUG=yes

which produces the result I need.

I would like to see some comments about this. As far as I can see there are no other scripts (installed on my system) which use the IN_HOTPLUG variable. I suspect that it was intended to be used in this way. Can anyone confirm this? I checked out the latest version of hotplug (without installing it though) to see if the IN_HOTPLUG variable was set somewhere but couldn't find it.

thanks,

Z

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#1 lore raw

I'm not quite clear on the problem Mandrake's scripts are expecting to solve here. But it's long seemed to me that the network admin scripts should get better support for dynamically adding/removing interfaces, and this ONBOOT problem is cut from the same fabric.

Quoted 2 lines

I checked out the latest version of hotplug (without installing it though) to see if the IN_HOTPLUG variable was set somewhere but couldn't find it.

It'd be easy to add this to /sbin/hotplug, to support "if (coming from...)" style spaghetti coding in admin scripts. But I'd rather leave such stuff to distro vendors.

- Dave

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel