View previous topic :: View next topic |
Author |
Message |
haarp Guru
Joined: 31 Oct 2007 Posts: 535
|
Posted: Sun Jan 18, 2009 1:17 pm Post subject: [solved] Delay PPP interface |
|
|
Hi.
I am using the net.ppp0 initscript to start my DSL connections (over PPPoE). This works fine, but I have a few services starting after that which depend on this interface.
Now when ppp0 starts, I get this:
Quote: | WARNING: net.ppp0 has started but is inactive |
indicating that it has not logged in yet. This is usually a matter of seconds. In this period of time however, other services continue to start and fail since I don't have an external IP yet.
Is there a way to add a delay after ppp0 has started for it to get an IP?
For the record, I tried this in /etc/conf.d/net:
Code: | postup() {
if [[ "${IFACE}" == "ppp0" ]] ; then
# Wait for connection to be ready to communicate
sleep 5
fi
return 0
}
|
But it doesn't seem to have any effect...the bash-prompt returns instantly when I start net.ppp0 manually, and it also won't delay other services depending on it at boot-time
Last edited by haarp on Sun Jan 25, 2009 1:58 pm; edited 1 time in total |
|
Back to top |
|
|
ewaller Apprentice
Joined: 11 Aug 2005 Posts: 264 Location: Pasadena, CA
|
Posted: Sun Jan 18, 2009 4:15 pm Post subject: |
|
|
Out of curiosity, you using ifplugd?
If so, I could see it cause this problem (by not waiting for the interface to come up, but backgrounding it),
If not, it might fix your problem (by starting dependent services when it does come up). _________________ Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday |
|
Back to top |
|
|
haarp Guru
Joined: 31 Oct 2007 Posts: 535
|
Posted: Mon Jan 19, 2009 4:46 am Post subject: |
|
|
Doesn't ifplugd monitor whether the cable is plugged in, not if a logical connection is present? |
|
Back to top |
|
|
mrness Retired Dev
Joined: 17 Feb 2004 Posts: 375 Location: bucharest.ro
|
Posted: Sun Jan 25, 2009 9:25 am Post subject: |
|
|
Services shouldn't depend on a specific network interface. If you have such services, then I suggest you add "need net.ppp0" in their depend(), because PPP interfaces could go down and up again at any time, outside user's control.
Letting this aside, if you want net.ppp0 init script to wait until the connection is started, use "updetach" in pppd_ppp0. Another way would be to set RC_NET_STRICT_CHECKING=yes in /etc/conf.d/rc ("need net" will be equivalent with "need net.*"). |
|
Back to top |
|
|
haarp Guru
Joined: 31 Oct 2007 Posts: 535
|
Posted: Sun Jan 25, 2009 9:54 am Post subject: |
|
|
The problem is not the service itself, but the process of getting an IP. net.ppp0 starts up alright, and other services already depend on it. net.ppp0 takes a while to get an IP -after- it's already started. 'updetach' does seem to make a difference tho, delaying the service until the IP is present. Thanks for the info. |
|
Back to top |
|
|
|