Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved] Delay PPP interface
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
haarp
Guru
Guru


Joined: 31 Oct 2007
Posts: 535

PostPosted: Sun Jan 18, 2009 1:17 pm    Post subject: [solved] Delay PPP interface Reply with quote

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
View user's profile Send private message
ewaller
Apprentice
Apprentice


Joined: 11 Aug 2005
Posts: 264
Location: Pasadena, CA

PostPosted: Sun Jan 18, 2009 4:15 pm    Post subject: Reply with quote

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
View user's profile Send private message
haarp
Guru
Guru


Joined: 31 Oct 2007
Posts: 535

PostPosted: Mon Jan 19, 2009 4:46 am    Post subject: Reply with quote

Doesn't ifplugd monitor whether the cable is plugged in, not if a logical connection is present?
Back to top
View user's profile Send private message
mrness
Retired Dev
Retired Dev


Joined: 17 Feb 2004
Posts: 375
Location: bucharest.ro

PostPosted: Sun Jan 25, 2009 9:25 am    Post subject: Reply with quote

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
View user's profile Send private message
haarp
Guru
Guru


Joined: 31 Oct 2007
Posts: 535

PostPosted: Sun Jan 25, 2009 9:54 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum