Supernova99
Posts: 2
Joined: Thu Nov 12, 2015 3:00 pm
Location: Somerset

OpenVPN fails to start on bootup

Thu Nov 12, 2015 4:13 pm

Hi,

Apologies if this has been asked before.

I am new to the Rpi and linux, but very capable of understanding technical issues and troubleshooting them.

I decided that I needed to make my own VPN server, as I travel extensively and I wanted something more secure when away, especially using open public WiFi hotspots.

So I came across a great How-to build a VPN server using a Rpi and OpenVPN
http://www.bbc.co.uk/news/technology-33548728

I installed Raspbian (4.1.12+) and updated and upgraded to the latest.

I followed the How-to exactly, but I did run into a few issues, which I patiently resolved by using our friend Google.
All was working as expected, except once I rebooted, the iptables were never restored.
The main issues were around saving iptables, which I managed to resolve using iptables-persistent.
http://blog.mxard.com/persistent-iptabl ... i-raspbian

However during the install of this, the post advised that I upgrade my Pi firmware and distro.
Once all was installed I noticed that on bootup I was getting a [FAILED] Failed to start OpenVPN connection to server.
See 'systemctl status [email protected]' for details.

So I ran the command [systemctl status [email protected]] as suggested by the failure, and indeed the OpenVPN service (which had been running previously before) was stopped.
I then tried to start it using the command
[service openvpn start]
I checked the status of the service and it is now running.
I rebooted the Rpi but I could still see that on startup it was still failing to start.

Another Google took me to creating a startup script -
/etc/rc.local
I added the command
[sudo service openvpn start &]

Now when I bootup I can still see the service fail, but then a few lines below, I can now see that it has started.

All is good the openVPN service, survives a reboot.

My question as a newbie is this -
Is this the correct fix?
The service should autostart from it's own script -
/etc/init.d/openvpn
It is somehow not starting by itself during bootup.

Should I add the openvpn script into the rc.local?

I have had a look at the script and it is quite complicated, and a bit above my head to understand all the parameters and switches.
I would just like to understand why it is not loading at startup, and perhaps fix it correctly rather than use a workaround.
openvpn.zip
openvpn script file
(2.84 KiB) Downloaded 47 times
Something changed in the software/firmware upgrade, that now prevents the openvpn service from starting on bootup.

Any help greatly appreciated.

I hope someone out there can shed some light.

tieke
Posts: 1
Joined: Wed Feb 03, 2016 9:58 pm

Re: OpenVPN fails to start on bootup

Wed Feb 03, 2016 10:08 pm

This reply is probably a bit late for you, but I had the same issue and fixed it by commenting out the initial line in the server.conf file - ie it now says # local 192.168.0.136.
Hope that helps.

Return to “Troubleshooting”