hasafly
Posts: 3
Joined: Thu May 23, 2019 6:31 am

OpenVPN Autostart Fail/Bug on Power On?

Thu May 23, 2019 7:19 am

Hi folks,

i'm using RPI3, with Raspbian and i installed OpenVPN, and is successfully working (as Client).

I want that this VPN ALLWAYS ON, and so i configured it out in "/etc/default/openvpn" file (AUTOSTART "MyVPN" - where "MyVPN.conf" is the config file placed on "/etc/openvpn/").

This AUTOSTART works very good, but only when i reboot RPI3....

If i plugged out power cord,and then powered it ON to start RPI for 1st time.....VPN doesn't come UP.....and got this error on deamon log:
Inactivity timeout (--ping-exit), exiting
SIGTERM[soft,ping-exit] received, process exiting

After this first startup, if i reboot RPI3, then it connects OpenVPN flawless...

Any idea what i can do?

Regards

epoch1970
Posts: 2805
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: OpenVPN Autostart Fail/Bug on Power On?

Thu May 23, 2019 9:19 am

You can read the manual for OpenVPN.
https://openvpn.net/community-resources/reference-manual-for-openvpn-2-4/ wrote: –ping-exit n
Causes OpenVPN to exit after n seconds pass without reception of a ping or other packet from remote.
–ping-restart n
Similar to –ping-exit, but trigger a SIGUSR1 restart after n seconds pass without reception of a ping or other packet from remote. [...] If the peer cannot be reached, a restart will be triggered, causing the hostname used with –remote to be re-resolved (if –resolv-retry is also specified) [...] Also note that –ping-exit and –ping-restart are mutually exclusive and cannot be used together.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

hasafly
Posts: 3
Joined: Thu May 23, 2019 6:31 am

Re: OpenVPN Autostart Fail/Bug on Power On?

Thu May 23, 2019 10:31 pm

Didn't work for me...
already used ping-restart and even keepalive commands.....


i have the idea that the lan0 its not ready when OpenVPN service tries to get ON......

that's my idea, because this issue only occurs on 1st boot (1st time connect the power to raspberry)

Another tip: after first boot, the openvpn doesn't start automatically (because that error on 1st post), but if run command "systemctl start [email protected]" it starts flawless.....

So that's why i'm losing my mind with this!!!

klricks
Posts: 6374
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: OpenVPN Autostart Fail/Bug on Power On?

Fri May 24, 2019 4:16 am

Maybe try enabling the .... Wait for Network at Boot.... option in sudo raspi-config
Unless specified otherwise my response is based on the latest and fully updated Raspbian Stretch w/ Desktop OS.

Return to “Raspbian”