[stunnel-users] Stunnel 5.44 server side 'exec = pppd' runs second child 'pppd' process after reconnection. Bug?

Eric Eberhard flash at vicsmba.com
Tue May 14 20:30:29 CEST 2019


That is not a bad idea.  I'd wrap it in a C program so I could check if the pppd is alive and not a zombie.  BUT -- it begs the question, why only ONE?  Every time this happens the process ID would change.  Is it serialization or?  I am thinking there is something we don't know ... I have offered Martin some help ...

E

-----Original Message-----
From: stunnel-users [mailto:stunnel-users-bounces at stunnel.org] On Behalf Of Florian Lohoff
Sent: Tuesday, May 14, 2019 12:57 AM
To: Martin Got <martingot at protonmail.com>
Cc: stunnel-users at stunnel.org
Subject: Re: [stunnel-users] Stunnel 5.44 server side 'exec = pppd' runs second child 'pppd' process after reconnection. Bug?


Hola,

On Mon, May 13, 2019 at 04:07:57PM +0000, Martin Got wrote:
> So second 'pppd' process started and runs simultaneously with the 
> first 'pppd' and link down. Restarting Stunnel server can clear child 
> 'pppd' processes. So newly reestablished 'pppd' link between 10.0.1.1 
> <--> 10.0.1.2 endpoints works till next interconnection.

You might have multiple options - You could use the parameters like peer passed to ip-up.d scripts use to kill the other instance on ip-up.

Run pppd through a wrapper to kill the old instance. Use linkname to write a specific pid file.

	#!/bin/sh
	linkname=test
	[ ! -f /var/run/ppp-${linkname}.pid ] || kill $(cat /var/run/ppp-${linkname}.pid)
	exec pppd linkname ${linkname} $*

Or you could use the routing table to find the interface and kill the pppd based on that.

	#!/bin/sh
	iface=$(ip -o r get ${REMOTE_IP_ADDRESS}  | sed -e 's/.*dev //' -e 's/ .*$//')
	[ -z ${iface} ] || kill $(cat /var/run/ppp-${iface}.pid) ]
	exec pppd $*

Both completely untested.

I would at least configure lcp-echo-failure and lcp-echo-interval so the old pppd instance will soon die because of the missing connection.
IIRC the default is 3/10 so after 30 seconds the old instance will die anyway.

> pppd[39187] pppd 2.3.5 started by user, uid 0 pppd[43231] Using 
> interface ppp1 pppd[43231] Connect: ppp0 <--> /dev/ttyp2 pppd[43231] 
> Local IP address 10.0.1.1 pppd[43231] Remote IP address 10.0.1.2 
> pppd[39187] pppd 2.3.5 started by user, uid 0 pppd[39187] Using 
> interface ppp0 pppd[39187] Connect: ppp0 <--> /dev/ttyp5 pppd[39187] 
> Couldn't set interface address: Address 10.0.1.1 or destination 
> 10.0.1.2 already exists

Flo
-- 
Florian Lohoff                                                 f at zz.de
        UTF-8 Test: The 🐈 ran after a 🐁, but the 🐁 ran away




More information about the stunnel-users mailing list