You are not logged in.

#1 2003-07-26 13:21:28

hcman
Member
From: Missoula, MT/Zaandam, Netherla
Registered: 2003-06-10
Posts: 66

network startup

At home I have my laptop with arch linux connected to my computer downstairs and the network is configured using dhcp. When I take my laptop with me to work it is not connected however and it sits there trying to connect to a computer that isn't there because it is not hooked up to anything. After a while it decides the network is down and gives me a login prompt.

Is there a way to reduce the time it waits before it gives me a prompt?

I have looked in the /etc/rc.d/network script but that doesn't make a whole lot of sense to me.
Anyone have any ideas on this? (perhaps reducing the time it waits is a bad idea...I dunno)

Thanks!
HC

Offline

#2 2003-07-26 14:09:54

sarah31
Member
From: Middle of Canada
Registered: 2002-08-20
Posts: 2,975
Website

Re: network startup

why not stop the network while you are disconnected?

as root:

/etc/rc.d/network stop


AKA uknowme

I am not your friend

Offline

#3 2003-07-26 15:04:42

hcman
Member
From: Missoula, MT/Zaandam, Netherla
Registered: 2003-06-10
Posts: 66

Re: network startup

well yeah but I turn my computer off, disconnect the cables and take it to work and then turn it on again. At that moment it tries to start the network at boot-up and it does so for a few minutes before I get a prompt. I cannot interreupt that process, only thing I can do is wait for it to figure out it is not connected. I was wondering if there is a way around this.

HC

Offline

#4 2003-07-26 20:40:33

sarah31
Member
From: Middle of Canada
Registered: 2002-08-20
Posts: 2,975
Website

Re: network startup

a bit of a kludge but just before you powerdown the laptop for transport stop the network. then go into your /etc/rc.conf and commnetout your network section, like so:

#
# Daemons to start at boot-up (in this order)
#   (prefix a daemon with a ! to disable it)
#
DAEMONS=(!pcmcia !network crond inetd mysqld lpd uptimed)

note a exclamation mark preceding the network entry will disable it as per file instructions above.


AKA uknowme

I am not your friend

Offline

#5 2003-07-26 21:58:32

Gyroplast
Member
From: Germany
Registered: 2002-09-03
Posts: 166
Website

Re: network startup

G'morning!

To work around sarah's workaround wink you might alternatively want to decrease the timeout lenght for DHCP requests. To do this, you need to edit the /etc/rc.d/network script and look for the ifup() function right at the beginning. Somewhere around line 13 you should find the dhcpcd program being executed. Right before the "-h $HOSTNAME" part, add a nice -t <timeout> parameter, with <timeout> being maybe 5 seconds. If that's not long enough, increase until your DHCP requests are answered in a timely fashion. The default is 60 seconds, and with that timeout being down to 5 (I'm having no problems with that setting in my LAN here) it effectively does not matter whether your DHCP server is available or not in respect to bootup time. Keep in mind that this file may be overwritten by pacman when the "initscripts" package is updated.

Greets,
  Dennis


"That's the problem with good advice. Nobody wants to hear it."
-- Dogbert

Offline

#6 2003-07-27 13:43:37

hcman
Member
From: Missoula, MT/Zaandam, Netherla
Registered: 2003-06-10
Posts: 66

Re: network startup

Thank you Sarah and Dennis! :-)
I think I will opt for commenting out the network section if I know I won't be using it for some time. Right now I am transporting it between home and work so I'll go with reducing the time out setting for now.

HC

Offline

#7 2003-08-14 18:05:33

dp
Member
From: Zürich, Switzerland
Registered: 2003-05-27
Posts: 3,378
Website

Re: network startup

... adding a "-t 12" to the ifup() /etc/rc.d/network was the first thing i changed after installing arch on my laptop and booting offline the first time waiting 1min ... it is a nice workaround (you have to use on some distros with simmilar startup-scripts) but it leads to some not nice things:

-> if you connect again to a LAN, you have to start the network manually (# /etc/rc.d/network start)

-> in shutdown-sequence, it will complain about network not running

=> it works, of course, but as i'm a semi-perfectionist, i was thinking about another way to solve the 1min-waiting:

i wanted to actually background "dhcpcd" imediately after start, so that the bootprocess can go on and the "dhcpcd" waits in the background for an answer the whole 60s
(at the UNI, we have a really slow dhcp-server, that if i had the -t to less than 28 i dont get an ip :-( but on the other side, i dont want to wait 29s to know that there is no LAN connected to my laptop)

unfortunately the dhcpcd has no option to go to background  sad

-> anybody to know how to say the dhcpcd to go to background (without rewriting the whole startup-scripts!)?

then i got an idea about another way to handle this: what about changing the /etc/rc.multi to offer to press a key (e.g. "n" == "This Daemon? [N]o thanx!") while a daemon is starting to stop the starting of this daemon

the advantage of a such solution: you dont need to set an timeout-value which may hinder you to connect to a LAN that responds slowly or have to wait for nothing

:::: the problem is: i have no idea how you can do this () --- gurus, please help ... the part that has to be changed looks now like this:

# Start daemons
for daemon in "${DAEMONS[@]}"; do
  if [[ `echo $daemon | grep '^[^!]' | wc -l` -eq 1 ]]; then
    /etc/rc.d/$daemon start
  fi
done

-> shortly said: i want to be able to kill "/etc/rc.d/$daemon start" while it is running by pressing only one key on my keyboard


The impossible missions are the only ones which succeed.

Offline

Board footer

Powered by FluxBB