You are not logged in.

#1 2012-09-19 19:15:39

aardwolf
Member
From: Belgium
Registered: 2005-07-23
Posts: 304

starting network later

Hello,

Sometimes when I boot up my computer, there's no network. The solution then is to type "/etc/rc.d/network restart" as superuser.

When I shut down my computer, I also shut down all the power, including the modem.

When starting it up, I turn on the power, and then the computer. While the computer boots up, the modem is also starting up (it's an ADSL modem).

Since sometimes I have network, sometimes not, I think it depends on how fast the modem started up that I have it or not. That's just my theory though. I think if ArchLinux would just init the network a little bit later, the problem would be gone.

Is there any way to make it do the network only after initializing everything else?

Or do you know any other (better) solution for this annoyance?

Thanks!

Offline

#2 2012-09-19 19:25:21

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: starting network later

Are you backgrounding your network daemon? https://wiki.archlinux.org/index.php/Da … Background
You can try putting

(sleep 300 && rc.d restart network) &

in your /etc/rc.local or disable 'network' daemon in your rc.conf

!network

and run

(sleep 300 && rc.d start network) &

from your /etc/rc.local.

Offline

#3 2012-09-19 19:43:53

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: starting network later

You're talking about two completely independent unconnected power-ons - one for your computer, one for your modem. No matter how late Arch initialises the network,  there is always the chance that it will be too early for your modem.

Solution: write a custom network init script that tests for connectivity, and loops over the required command(s) until the connection is established.

Offline

#4 2012-09-19 19:51:55

aardwolf
Member
From: Belgium
Registered: 2005-07-23
Posts: 304

Re: starting network later

tomk wrote:

You're talking about two completely independent unconnected power-ons - one for your computer, one for your modem. No matter how late Arch initialises the network,  there is always the chance that it will be too early for your modem.

Solution: write a custom network init script that tests for connectivity, and loops over the required command(s) until the connection is established.


The thing is, I never had this problem with my previous computer. My previous computer was 5 year old, and the Archlinux on it too (with 5 years of pacman -Syu history). So at least the two independent unconnected power-ons seem to be no problem for some Arch boxes. I've never created background daemons there either, or done any delay, it just never was a problem there.

This new computer (well, half a year old in the meantime) has this problem.

So maybe there was something better about how the old one was configured, but what could that be?

Last edited by aardwolf (2012-09-19 19:54:44)

Offline

#5 2012-09-19 20:26:02

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: starting network later

Ehmm.... no, the old one was just slower.

Try the sleep 300 thing if you want, you might be happy with the result. It's just not the smartest way to do this.

Offline

#6 2012-09-19 20:43:40

2ManyDogs
Forum Moderator
Registered: 2012-01-15
Posts: 4,645

Re: starting network later

aardwolf wrote:

Or do you know any other (better) solution for this annoyance?

Other, but maybe not better: don't turn the modem off.

Other and better, test for connectivity as tomk suggests. This should not be that difficult.


How to post. A sincere effort to use modest and proper language and grammar is a sign of respect toward the community.

Offline

#7 2012-09-20 20:40:02

zorro
Member
Registered: 2011-11-18
Posts: 47

Re: starting network later

At boot, one of my arch installations sometimes created the network correctly, other times it failed - required manual start. This was a race condition between eth0 being created and the network using eth0. I am using systemd and needed to update /etc/systemd/system/network.service, as shown

old:

Wants=network.target
Before=network.target

new:

Requires=sys-devices-pci0000:00-0000:00:04.0-0000:01:06.0-net-eth0.device
After=sys-devices-pci0000:00-0000:00:04.0-0000:01:06.0-net-eth0.device

Obviously, you will need to use your own device name.

Offline

Board footer

Powered by FluxBB