alex wrote:

>>   Because we think if pppd+pppoa2/3 are not able to reconnect your box 
>>25 times, they will allways fail.
>>
> 
> I'm assuming if you look in your log files if your link fails after 25
> times you have a running pppoa2/3 (the original one) and all the
> respawned ones failing because they couldn't get the usb interface.
> 


Yes, i think you're right. You should have one pppoa3 still running (1 
process == 4 threads in Linux systems). I think pppd is buggy but i 
didn't find where the problem is.


> This problem does occur when pppoa2/3 doesn't shutdown cleanly with
> pppd. Unfortunatly I haven't found out why yet! I'm sure its a signal
> thing but finding good info on pppd's control of ptys is a pain. Any
> pointers anyone? where is pppd developed?
> 


No pointers, I don't even know who maintains pppd !


Btw, i think I've found a good solution to this problem. pppoa3 now uses a pid file. I 
told you I've implemented a --clean option to pppoa3. But as you suggested me (and as 
i thought) this solution introduced a racing problem when cleaning the old pppoa3.


My solution description :


1 - start

2 - creates an IPC semaphore with  semget (and PC_CREAT|IPC_EXCL)
     if the semaphore already exists, the semget returns -1 and
     sets errno to EAGAIN so we know another instance has not cleanly
     exited (or is still running).

    21 - if "--clean|-c" option has been specified then :

       210 - open the pidfile and read the previous instance pid
       211 - kill the process group (the process and all threads)
       212 - grab the semaphore so this process is sleeping untill
             the previous instance releases the semaphore
       213 - destroy the semaphore (since we can't know the old
             instance has already destroyed it)
       213 - repeat the semaphore creation, but this time we are
             sure to be able to create it because :
                - the old instance tried to delete it
                - this instance tried to delete it too

3 - Grab the semaphore
4 - create the pid file...(O_CREAT|O_TRUNC), writes the pid in it
5 - do normal job (threads read/write/pipe ...)
6 - unlink pid file
7 - release the semaphore
8 - destroy the semaphore
9 - exit

   I think the semaphore usage avoid the racing condition on the pid 
file creation/destruction between both pppoa3 instances.
   That's the cleanest solutin i've found, tell me if you have one which 
is better.



Edouard Gomez


NB : we can use the smallsem lib included in the driver package to implement this 
solution.



Liste de diffusion modem ALCATEL SpeedTouch USB
Pour se d�sinscrire : mailto:[EMAIL PROTECTED]?subject=unsubscribe

        

Reply via email to