Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 193578 - sys-apps/baselayout-2.0.0_rc4-r1: pppd.sh returns too early for pppd_ppp0=updetach
Summary: sys-apps/baselayout-2.0.0_rc4-r1: pppd.sh returns too early for pppd_ppp0=upd...
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-09-23 23:17 UTC by Martin Väth
Modified: 2007-09-24 18:07 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Väth 2007-09-23 23:17:34 UTC
Although /lib/rcscripts/net/pppd.sh waits in case of 'updetach' with ifconfig/iproute2 for the interface, it may happen that this interface is ready before pppd has finished everything (e.g. I observed that it will usually return before all scripts in /etc/ppp/ip-up.d are executed).
Moreover, probably for the same reason, I usually even get a warning saying that ppp0 is up but not active (to the effect that the return code of "/etc/init.d/net.ppp0 start" is not 0 although the interface will be working some seconds later). I guess if you want to reproduce the problem you should perhaps put some sleep's into the /etc/ppp/ip-up.d scripts.

However, I am not sure about the reason:

Either the problem is that start-stop-daemon sends pppd immediately in the background and does not wait until it would finish normally even in case of ${hasupdetach}?

Or maybe this bug is actualy not related with baselayout but with net-dialup/ppp (tested with 2.4.4-r13)?
Comment 1 Roy Marples (RETIRED) gentoo-dev 2007-09-24 07:04:53 UTC
If I understand you correctly, what you are describing is NOT a bug. Basically, pppd.sh knows that pppd will continue the interface configuration when it has a connection so it stops and goes inactive.

inactive means that the interface is "down", but has a controlling daemon to fully bring it "up". ifplugd does the same for cable in/out for wired and wpa_supplicant for wireless networks.

If you disagree then maybe mrness could shed more light on this.
Comment 2 Alin Năstac (RETIRED) gentoo-dev 2007-09-24 07:19:05 UTC
This is not related to baselayout in any way. And yes, it is not a bug, it is the way pppd was designed.

When updetach option is specified, pppd will detach as soon as PPP negociation ends. You will have an IP on ppp interface and everything, but the ip-up script might still run.
Comment 3 Martin Väth 2007-09-24 13:04:17 UTC
Thanks for the explanation.

In this case, baselayout would either need some option so that /etc/init.d/net.ppp0 waits (with a timeout) until the interface is active, or "need net.ppp0" would have to wait until this happens: Otherwise, it might happen that some service are sometimes started and sometimes not started (depending on whether the interface could be activated "fast enough").
Comment 4 Roy Marples (RETIRED) gentoo-dev 2007-09-24 13:14:04 UTC
The current default is that a virtual service is defined by services that provide it in the boot and current runlevels. So net.lo provides "net" by default.

If you wish net.ppp0 to be included in this, then either add it to your default runlevel OR add RC_NEED="net.ppp0" to the /etc/conf.d/foo where foo is the name of the service that needs this dependency.
Comment 5 Alin Năstac (RETIRED) gentoo-dev 2007-09-24 13:19:53 UTC
If I remember correctly, services that satisfy the following conditions:
  1) are listed in the current runlevel 
  2) depend on net.ppp0 
will get started on inactive->started transition of the net.ppp0 service and will get stopped on started->inactive transition.
Or am I wrong?
Comment 6 Martin Väth 2007-09-24 18:07:43 UTC
You are right. I was confused about some manually started services (not in the current runlevel) which did explicitly depend on net.ppp0:
Since they returned a nonzero value and did not produce their usual output, I false believed that they were not started. I did not realize that they were started later automatically once net.ppp0 got active.

Sorry for the noise.