PDA

View Full Version : starting network at boottime



Vasek
07-23-2004, 04:15 PM
Hi,
I have a small problem with starting network at boot-time after knoppix-hd-install.

I have added /etc/init.d/networking into the default runlevel, but it is probably not executed as expected.
$ ls /etc/rc5.d/
S02sysklogd S05klogd S10networking S20cupsys S20samba S99kdm

At the boot I get something like:
starting syslog
starting klogd
doing rp_filter... device already configured (?)
starting cupsys
...

But the network is not configured. More precisely it is configured with old (default) IP, etc.
$ ifconfig
shows eth0 is active with default IP

invoking /etc/init.d/networking restart manually solves the problem...

Any idea what is wrong? Why it fails at the first run?

Thanks,

Vasek

shah
07-24-2004, 03:58 AM
My sugestion:
1)Remove S10networking from rc5.d
2)Edit /etc/init.d/knoppix-autoconfig
Look at 2/3 to the bottom which has these lines:
# Fat-Client-Version: DHCP Broadcast for IP address
if checkbootparam "nodhcp"; then
echo " ${BLUE}Skipping DHCP broadcast/network detection as requested on boot commandline.${NORMAL}"
else
NETDEVICES="$(awk -F: '/eth.:|tr.:/{print $1}' /proc/net/dev 2>/dev/null)"
for DEVICE in $NETDEVICES
do
echo -n " ${GREEN}Network device ${MAGENTA}$DEVICE${GREEN} detected, DHCP broadcasting for IP.${NORMAL}"
trap 2 3 11
# -i $DEVICE >/dev/null 2>&1 & <---comment out this line
/etc/init.d/networking restart <---add this line
trap "" 2 3 11
sleep 1
echo " ${BLUE}(Backgrounding)${NORMAL}"
done
fi

Restart your conmputer and run ifconfig -a to check.

user unknown
07-26-2004, 02:02 AM
What is the default ip?

You could search for it in etc like this:


cd /etc
grep -R 192.168.0.1


Perhaps in /etc/sysconfig/network
the values are set?

Vasek
07-26-2004, 10:33 AM
Thanks shah, your suggestion works.

Though, it seems to be a bit hackish :-).
I wanted to try a cleaner solution:



if checkbootparam "nodhcp"; then
echo " Skipping DHCP "
else
# -i $DEVICE >/dev/null 2>&1 & <---comment out this line
/etc/init.d/networking restart <---add this line
fi


I thought, that I can avoid the problem by adding "nodhcp" to my lilo.conf, our network do not support it anyway.
However, it did not work, the condition went the "else" way...

shah
07-26-2004, 12:11 PM
Okay, if you scared or don't want to change anything in knoppix-autoconfig, you can read this post on how to make a script :
http://www.knoppix.net/forum/viewtopic.php?t=12067

OR you can simply make a script that contain single line:
/etc/init.d/networking restart
and place it in /etc/rc5.d

REMEMBER....you have to remove your networking symlink in /etc/rc5.d. We don't want networking to start three times.

You don't have to put nodhcp in your lilo.

Happy learning
:D :D :D :shock: :shock:

bob58
07-26-2004, 02:00 PM
Hello, i have a question that seems pretty close to this bunch here. I have a laptop and it has Knoppix 3.4.....I would like to know how to have start up skip detecting the network. I mostly use the computer off-line, but on occasion connect my cable modem to it. I would rather have the option to manually configure network card myself. This is mainly because it slows down the start up waiting for it to run. On my desktop, its not a problem cause i use that on internet alot more than laptop. So what i want to do is have laptop boot, and skip the network detection, and if i want to use internet, i can manually configure the network card from the menu...thanks...bob58

bob58
07-26-2004, 02:06 PM
Hello, i have a question that seems pretty close to this bunch here. I have a laptop and it has Knoppix 3.4.....I would like to know how to have start up skip detecting the network. I mostly use the computer off-line, but on occasion connect my cable modem to it. I would rather have the option to manually configure network card myself. This is mainly because it slows down the start up waiting for it to run. On my desktop, its not a problem cause i use that on internet alot more than laptop. So what i want to do is have laptop boot, and skip the network detection, and if i want to use internet, i can manually configure the network card from the menu...thanks...bob58

shah
07-27-2004, 03:50 AM
Bob58

Sorry,you cannot skip network detection on boot time because it was part of knoppix-autoconfig. Unless you want to edit your knoppix-autoconfig.
I don't see it slow down the start up process since it is backgrounding.
Unlike other distro, it will wait few minutes to detect if you didn't assign any ip address.

user unknown
07-27-2004, 03:47 PM
Make a backup of the knoppix-autoconfig.

Edit the original

Restore it from the backup if you made mistakes.

You will make mistakes, but you will learn if you don't give up.

bob58
07-27-2004, 05:29 PM
This reply is for "user unknown".......Can you help me with this? I hate to sound nit picky, but the reason I want to avoid auto network detection on bootup is that i find sometimes i have little time to use computer and like to get on and off quickly. I dont always use my cable internet connection on it and would rather configure it manually when i do from menu. Between the time it takes to do the network detection and the 2 other error messages i posted in here a few days ago, it eats up valuable boot time. I am just trying to save time. Isnt that what Linux is about? customization???? Hahahaha! Among other cool things. I just want to have computer boot quicker thats all.
Where would i find the file "knoppix-autoconfig"?
and what do i have to add or remove from it to modify it? bob58

user unknown
07-27-2004, 09:47 PM
Well - the knoppix-autoconfig (k-a) is a big big script in /etc/init.d.

I used SuSe ca. 1992, redhat at 96, peanut-linux and halloween - now knoppix.

Every distro has it's own procedure of booting, and they evolve over time - so I guess what suse does nowadays is pretty much different from what they did 10 years ago.

A few weeks ago I had a bootup to console of 25 sec. (at 1.1 Ghz).
Then my harddrive headcrashed, and I started from scratch.

The k-a is used and useful if nearly nothing is known about your hardware, so a lot of searches and tests are done, which indeed consume much time. It handles bootoptions as well.

I removed brltty-stuff, harddrive-detection, multiple language-settings, pcmcia-stuff and lot's more which I understood and could say: "I don't need it".

But if don't know the scripting-language, and no computerlanguage at all, it will be very hard to tell for each detail, whether you need it or not.

Ok - I had a look at my backup, and would say:
You do it on your own risk!
Make a backup first!
remove these lines (ca. line 900)


# Fat-Client-Version: DHCP Broadcast for IP address
if checkbootparam "nodhcp"; then
echo " ${BLUE}Skipping DHCP broadcast/network detection as requested on boot commandline.${NORMAL}"
else
NETDEVICES="$(awk -F: '/eth.:|tr.:/{print $1}' /proc/net/dev 2>/dev/null)"
for DEVICE in $NETDEVICES
do
echo -n " ${GREEN}Network device ${MAGENTA}$DEVICE${GREEN} detected, DHCP broadcasting for IP.${NORMAL}"
trap 2 3 11
pump -i $DEVICE >/dev/null 2>&1 &
trap "" 2 3 11
sleep 1
echo " ${BLUE}(Backgrounding)${NORMAL}"
done
fi

but you could as well first boot with bootparameter 'nodhcp' - and if it speeds up your things, make an entry in '/etc/lilo.conf': 'append="nodhcp"' - syntax unproofed - and rerun lilo. Voila.

P.S.: In my opinion, this script should be improved by making it more modal.
It could contain lines like:
k-a-harddrives
k-a-pcmcia
k-a-keyboard
k-a-mouse
k-a-network
...
to make it better maintainable.

baldyeti
07-27-2004, 10:01 PM
FWIW, on my mepis box /etc/init.d/networking is linked to /etc/rc0.d/S35networking ... At S10 you may simply be starting it too early.