[stunnel-users] Stunnel 5.44 server side 'exec = pppd' runs second child 'pppd' process after reconnection. Bug?
Florian Lohoff
f at zz.de
Tue May 14 09:57:07 CEST 2019
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://www.stunnel.org/pipermail/stunnel-users/attachments/20190514/f70ed704/attachment.sig>
More information about the stunnel-users
mailing list