You are not logged in.

#1 2010-05-20 02:47:16

tony5429
Member
Registered: 2006-03-28
Posts: 1,025
Website

Make Network Daemon Wait Until Network is Ready?

I run an Arch64 server which is behind a router. I am also away from home a lot. If the power goes out I worry that there is a chance the server will boot up and the network daemon will give up before the router has booted back up, and then I will be unable to access my machine remotely until I can get home and reboot it manually. Does anyone know of a way to make the network daemon, upon starting up, wait for the network to become available no matter how long it takes? I guess I'm looking for a way to disable the network daemon's timeout period. Thanks in advance!

Last edited by tony5429 (2010-05-20 02:47:59)

Offline

#2 2010-05-20 03:31:45

demian
Member
From: Frankfurt, Germany
Registered: 2009-05-06
Posts: 709

Re: Make Network Daemon Wait Until Network is Ready?

http://bbs.archlinux.org/viewtopic.php? … 37#p697137

How do you know if Internet is available if the network daemon isn't started?


no place like /home
github

Offline

#3 2010-05-20 05:09:07

Sin.citadel
Member
Registered: 2008-01-22
Posts: 267

Re: Make Network Daemon Wait Until Network is Ready?

do u mean that your network interface wont get an ip address from the router (dhcp getting timed out)

Offline

#4 2010-05-20 14:00:09

tony5429
Member
Registered: 2006-03-28
Posts: 1,025
Website

Re: Make Network Daemon Wait Until Network is Ready?

Hrm.. maybe I didn't explain myself well enough. The machine is not using DHCP. Instead it tries to take the static IP 192.168.1.100 on the LAN, for which ports 80 and 22 are forwarded through the router so I can access it remotely. My concern is this: Whenever I turn on the machine with the router turned off, when Arch Linux gets to starting up the network daemon it will time out. So I worry that if the power goes out on both the router and the server and the power returns, if the Linux box tries to connect to the network before the network is ready, it could give up too fast and then I would not be able to access it remotely when the router actually did boot back up. So I'm just looking for a way to disable the network daemon's timeout option so that it tries forever until the network is available, regardless of how long that takes. Hope that makes sense. Thanks for the help!

Offline

#5 2010-05-20 14:18:13

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,019

Re: Make Network Daemon Wait Until Network is Ready?

If your ip is static, network daemon should set it properly anyway, no matter the connectivity.

Disconnect the cable, boot your pc, connect the cable and check if your net works.

Offline

#6 2010-05-20 15:39:59

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,690

Re: Make Network Daemon Wait Until Network is Ready?

A quick and nasty solution would be to write a script to see if it is up, and if not, try to put it up.

Set up a cron job to run the task periodically.  I would say once a minute is an overkill, once an hour might not be enough.  Maybe once every 10 minutes


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#7 2010-05-25 00:13:54

tony5429
Member
Registered: 2006-03-28
Posts: 1,025
Website

Re: Make Network Daemon Wait Until Network is Ready?

Thanks for all the responses! So I discovered along the way that because I am using static IP configuration if the router's not ready when the computer boots up, the network daemon still works just fine and then when the network is ready all is well. The issue would only arise if I were to use DHCP. If I ever end up in that situation I will follow ewaller's advice and write a cron script to try to start the network daemon if it's not already going. Thanks again!!

Offline

Board footer

Powered by FluxBB