LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Slack9 networt setup prob: rc.inet1 executed before rc.hotplug (https://www.linuxquestions.org/questions/slackware-14/slack9-networt-setup-prob-rc-inet1-executed-before-rc-hotplug-55394/)

yan1 04-16-2003 05:10 PM

Slack9 networt setup prob: rc.inet1 executed before rc.hotplug
 
In the orginal rc.M script of Slackware 9.0 rc.inet1 is executed before the rc.hotplug script.

-----------------<snip>--------------------------
# Initialize the networking hardware:
if [ -x /etc/rc.d/rc.inet1 ]; then
. /etc/rc.d/rc.inet1
fi
# Initialize the hotplugging subsystem for PCI, Cardbus, and USB devices:
if [ -x /etc/rc.d/rc.hotplug -a -r /proc/modules ]; then
# Don't run hotplug if 'nohotplug' was given at boot.
if ! grep nohotplug /proc/cmdline 1> /dev/null 2> /dev/null ; then
. /etc/rc.d/rc.hotplug start
fi
fi
-----------------<snip>------------------------

This canīt work (at least for me), cause in rc.inet1 the ip addresses are being set for the devices (with ifconfig), but the hardware devices (eth0 and so on) arenīt initialized yet (that happens during the hotplug).
So everyone who is having problems with such error messages:

Configuring eth0:
ifconfig eth0 192.168.1.1 broadcast 192.168.1.255 netmask 255.255.255.0
SIOCSIFADDR: No such device
eth0: unknown interface: No such device
SIOCSIFBRDADDR: No such device
eth0: unknown interface: No such device
SIOCSIFNETMASK: No such device

just exchange those two entrys in rc.M.
I hope i am right with the things I wrote, cause i am a slackware newbie.

greetings

Excalibur 04-16-2003 08:10 PM

Additional information on the Slack startup scripts:

If the problem is that the network device module is not loaded yet, then it is not really a hotplug issue. The network module should be loaded from rc.netdevice and that script is called from the rc.modules script. The script rc.modules is called near the end of the rc.S script which is the first script run after control is passed from init and before going multi-user (rc.M).

The rc.netdevice script is created by the netconfig setup script if it detects a module supported network adapter and then creates it if required. The Slack setup program offers to run netconfig during the install, but you can skip it if you choose to do so. A problem here could exist if you configure manually and do not load the module or change your NIC card without changing the module to load in rc.netdevice. Changing from a custom kernel with builtin NIC support to a stock kernel with module support without seting up the rc.netdevice would create the same symptoms.

If the system hasn't been configured to load the proper NIC module, then it would fall back to the hotplug system to load it. With the default scripts that would be loading the modules too late for the network config.

Perhaps it will help to clarify the issue to some extent.

yan1 04-17-2003 02:34 PM

During installation I just configured a loopback network with netconfig, but after installation I started netconfig again and setup it up with a static ip address. But no rc.netdevice was created by netconfig (I just tried this again.) and my network hardware is very common.

yan1 04-17-2003 07:12 PM

Okay, I tested everything again. The netconfig creates a rc.network file if you choose the dhcp setup (but not for static IP setup). And it only configures one ethernet-card. If you have more than one in your box, you have to set up the rest manually.
I think this is a bit confusing. In my opinion netconfig should either setup all networkcards (in every setup option) or leave them completely alone.

carboncopy 04-17-2003 08:14 PM

This has been the case since Slackware 8. And probably much earlier.

Yuh, confusing. Cause I didn't know about that until I was messing around with those config files.

Cheers. Now you know. Hehehe...

Excalibur 04-19-2003 07:26 PM

Well, I experimented with the netconfig script and found that it always probes and creates the rc.netdevice script when DHCP is chosen. It never does when loopback only is chosen, no NIC required. However, when Static IP is chosen, it will test if a NIC on eth0 is available in /proc/net/dev. If eth0 present then it does not probe or create the rc.netdevice script. If eth0 is not present then it will probe and create rc.netdevice. So then for static IP the script considers if eth0 support is provided by the kernel or module that is otherwise loaded.

So your problem appeared when you chose loopback only on initial setup and then run netconfig later manually and chose static IP assignment. And it wouldn't work because the NIC module was actually loaded by rc.hotplug that executes too late for network configuration. The module being loaded by rc.hotplug prevented the netconfig script from doing the proper setup because it detected eth0 present.

The problem would not have appeared in earlier versions of Slack because the hotplug system is new to Slack 9.

I will pass this thread to Slack support so they can evaluate the problem.

nickoljt 04-20-2003 02:15 AM

I have experienced this issue as well. I am using a LinkSys USB ethernet device and get my IP via DHCP. I found that hotplugging this device didn't work with the default hotplug scripts. I quickly hacked the default script "/etc/hotplug/net.agent" as follows. Hotplugging and booting the system now brings up the device and results in a connection. Obviously the other devices are broken and I didn't spend any time to avoid this, but as it is, my needs are met. Any improvements would be a good thing!

Original "net.agent"
-----------------------------------------------

<snip>
case $ACTION in
register)

case $INTERFACE in
# interfaces that are registered after being "up" (?)
ppp*|ippp*|isdn*|plip*|lo*|irda*)
debug_mesg assuming $INTERFACE is already up
exit 0
;;
# interfaces that are registered then brought up
*)
# NOTE: network configuration relies on administered state,
# we can't do much here without distro-specific knowledge
# such as whether/how to invoke DHCP, set up bridging, etc.

# Slackware Linux:
if [ -x /etc/rc.d/rc.inet1 ]; then
# Interface already up? If so, skip.
if /sbin/ifconfig | grep "^${INTERFACE} " 1> /dev/null ; then
debug_mesg run rc.inet1
exec /etc/rc.d/rc.inet1
fi
# RedHat and similar
elif [ -x /sbin/ifup ]; then
debug_mesg invoke ifup $INTERFACE
exec /sbin/ifup $INTERFACE
else
mesg "how do I bring interfaces up on this distro?"
fi
;;
esac
mesg $1 $ACTION event not handled
;;
</snip>


Hacked "net.agent"
-----------------------------------------------

<snip>
case $ACTION in
register)

case $INTERFACE in
eth*)
exec /etc/rc.d/rc.inet1
;;
esac
mesg $1 $ACTION event not handled
;;
</snip>

DavidPhillips 04-21-2003 12:24 PM

I have RedHat 6.1 and it too will run the eth0 initialization and fail before loading the nic pccard. However whet the pccard is loaded the nic is initialized and becomes the first available eth?


All times are GMT -5. The time now is 04:11 AM.