SIGTerm

Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking
Author Message
burgess85
DD-WRT User


Joined: 22 Sep 2012
Posts: 78

PostPosted: Sat Jun 27, 2020 13:04    Post subject: SIGTerm Reply with quote
If my main router disconnects or reboots my ddwrt vpn router drops the openvpn connection with error SIGTERM[soft,ping-exit] received, process exiting

How can I stop this from happening?
My config is

reneg-sec 0
persist-tun
persist-key
nobind
remote-random
remote-cert-tls server
route-metric 1
keepalive 15 60
Sponsor
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 10390
Location: Netherlands

PostPosted: Sat Jun 27, 2020 14:36    Post subject: Reply with quote
What router, which build?

Are you saying the VPN does not start/connect after a reboot?

_________________
Routers:Netgear R7800, R7000, R6400v1, R6400v2, Linksys EA8500, EA6900 (XvortexCFE), E2000 (converted WRT320N), WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
burgess85
DD-WRT User


Joined: 22 Sep 2012
Posts: 78

PostPosted: Sat Jun 27, 2020 20:33    Post subject: Reply with quote
egc wrote:
What router, which build?

Are you saying the VPN does not start/connect after a reboot?


R7000 latest beta build. No if my ISP router reboots the vpn on my ddwrt router drops and doesn't reconnect
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 10390
Location: Netherlands

PostPosted: Sun Jun 28, 2020 7:05    Post subject: Reply with quote
burgess85 wrote:
egc wrote:
What router, which build?

Are you saying the VPN does not start/connect after a reboot?


R7000 latest beta build. No if my ISP router reboots the vpn on my ddwrt router drops and doesn't reconnect


Right, well latest can mean a lot of things for me it is is build 43516 Smile
Which is a good build

I gather from your information that the trouble starts if your R7000 disconnects from the internet (when the ISP router upstream reboots or otherwise)

Unfortunately this is a known problem with VPN connections.

You can mitigate the problem by rebooting the router or restarting the VPN.
This process can be automated so that on disconnections the router reboots.
Administration/Keep Alive : Enable Watchdog

To only restart the VPN or restart the router when you are using Policy Based routing see the fourth post of this thread:
https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=321686

_________________
Routers:Netgear R7800, R7000, R6400v1, R6400v2, Linksys EA8500, EA6900 (XvortexCFE), E2000 (converted WRT320N), WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
SurprisedItWorks
DD-WRT Guru


Joined: 04 Aug 2018
Posts: 1355
Location: Appalachian mountains, USA

PostPosted: Sun Jun 28, 2020 15:27    Post subject: Reply with quote
I run this in my startup code to create a sort of junior version of the watchdog. This doesn't deal with hung connections but only with cases in which the openvpn process actually exits, which seemed to be your situation:
Code:
while sleep 29; do
  pidof openvpn >/dev/null || {
    echo 'restarting openvpn process' | logger -t "openvpn process sentinel"
    /usr/sbin/openvpn --daemon --config /tmp/openvpncl/openvpn.conf; }
done &

There is nothing special about "sleeping" for 29 seconds between looks to see if the process is still there. I just figured that I'd be able to identify the sleep in the output of ps by the 29. Pick any interval you like.

Also, the openvpn arguments are for recent builds. Builds a few months or more older will need extra arguments to the openvpn command to specify the route-up and route-down scripts. Do ps | grep [o]penvpn in the CLI to see how your invocation of openvpn should look.

_________________
4 Linksys WRT1900ACSv2 routers on 49081, 2 on 48141: VLANs, VAPs, NAS, client mode, OpenVPN client (AirVPN), DDNS, wireguard servers and clients (AzireVPN), three DNSCrypt DNS providers (incl Quad9) via VPN clients.
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum