Well, I'm going to explain what's wrong with the current postinstall ppp-udeb 
script and what is considered to be done by the previously posted patch.
First of all, the problem appears when you try to install the latest daily 
build of Debian netinst using PPP over Ethernet (PPPoE). After probing and 
setting up network hardware a PPPoE setup begins with concentrator discovery, 
which however fails. In logs you can see a string: "pppoe probe output size: 
15" (for me) - which means the concentrator is actually found.
To understand what's wrong look at the original ppp_concentrator_on() function 
in the attached file.
As you can see pppoe-discovery is started in the background, then its output 
through some pipelines is written to /tmp/probe-finished. Meanwhile a "while" 
loop waits for that file to appear.
But after the first (even successfull) loop "for" doesn't end up and 
pppoe-discovery is executed once more. As /tmp/probe-finished already exists 
"while" doesn't run and "for" ends up. Then the running pppoe-discovery process 
is being killed. And that's where the problem is as if killed quickly enough it 
outputs nothing and the result of the pipeline is 0 which is then written to 
/tmp/probe-finished. Meanwhile this file is being read in the main execution 
thread (just after killing the pppoe-discovery process). So if a zero value is 
written BEFORE the file is read the function returns 1 which means "no 
concentrators found". As a typical process race it can appear and disappear in 
different circumstances. For example it doesn't come in Alpha1 Debian Installer 
(Linux kernel 2.6.30) but does in latest daily builds (Linux kernel 2.6.32 - 
changes in process scheduler?). In my case a simple "dmesg &> /dev/null" or 
"sleep 1" or any other command which takes some time to execute past
 ed just after "R=$(/usr/sbin/pppoe-discovery ... wc -l)" gave enough time to 
successfully read the file before it is spotted.
The patch however does the trick in a more straight way: if the concentrator is 
found the "for" loop will be broken and it won't execute pppoe-discovery second 
time.
It also provides some useful fixes like removing /tmp/ppp-errors (which is 
never used outside the function), pre-removing both /tmp/probe-finished and 
/tmp/ppp-errors (as each new discovery process should start from scratch) or 
assuring the function returns false in case of any timeout.

Attachment: ppp-udeb.postinst.orig
Description: Binary data



Reply via email to