Ubuntu – OpenVPN won’t start on ubuntu – PID not found

openvpnUbuntu

I am running ubuntu version 12.04 LTS and I have installed OpenVPN on it. After a while of troubleshooting why my client won't connect (I have generated keys and confligured the client), I ran 'service openvpn status' from the command line and received the following error:

could not access PID file for VPN 'server'

I have rebooted, started and restarted the service, but each time I check the status, I receive the PID error. I'm pretty sure that I can't connect because the service isn't running.

Where can I begin troubleshooting this? I don't know what to look for. Any help is greatly appreciated.

Thanks!

Best Answer

could not access PID file for VPN 'server' means the PID file could not be read. This can have different reasons:

  • you do not have the rights to read the pid file -- did you run the command as root or with sudo?
  • the pid file does not exist, as the process is not running or could not create the file for some reason

Thus, for further debugging, you will need to look at /var/run/openvpn.server.pid itself

  • does it exist?
  • is there an openvpn process running with the pid listed in the file?
  • are there other openvpn processes running?

If the process is not running, your config is most probably wrong and you will have to read the logs why it did not start. Running service openvpn start might bring helpful output too.