Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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!

share|improve this question
    
try this when your Server has finished booting and is running as usual ps ax | grep openvpn please post the output of this command. –  zwarag Nov 13 '12 at 9:05
    
This is the only line that comes up: "root 24079 0.0 0.1 9376 888 pts/0 S+ 13:10 0:00 grep --color=auto openvpn" –  wahwahsoserious Nov 13 '12 at 13:10
    
this means that the openvpn is not running on the maschine you're using. –  zwarag Nov 14 '12 at 15:37
    
What's in your server.conf? Do you use the user or group options to change the user of the vpn process? if so, do the specified user and group exist? OpenVPN will also log something, either to syslog or to a logfile specified (file has to be writable by the user you specified). You can use the verb option to increase the verbosity of the log entries. –  Thomas May 30 at 7:41

4 Answers 4

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.

share|improve this answer

The init script just reporting that OpenVPN didn't start , (and do to that) can't read the pid file.
You have to check system/daemon/openvpn log to see why couldn't start.

share|improve this answer

The startup script will just try to start OpenVPN, but it will not give you any error messages if it fails. Manually execute OpenVPN

$ openvpn /etc/openvpn/server.conf

And solve any errors that you see there. If you do not see errors, check that you did not set log to off, and maybe increase verbosity with verb.

share|improve this answer

It seems like, you do not have an automatic start script! Which is usual. OpenVPN does not install such a thing by it self, as far as i know...

First of all try executing the server manually.
This will need an own Terminalwindows to run. And for the time OPENVPN is running this way, the TerminalWindow will not be usable for other stuff.

Try this (replace /etc/openvpn/config-files/ with your Path):

openvpn /etc/openvpn/config-files/server.conf

Some Information will appear in this Window.
Now try to connect to the Server with a client. You can shut the openvpn down by hitting CTRL+C

If this was the solution, do following for executing the OpenVPN-Server after your System has booted.

Do this in the terminal:

vim /etc/init.d/OnBootOpvenvpn.sh

and tipe in the following lines:

#! /bin/sh
# /etc/init.d/OnBootOpenvpn.sh #
openvpn /etc/openvpn/config-files/server.conf

This would be for the Server. Of course you have to change /etc/openvpn/config-files/ to your Path!!!

For Clients do the same, just be sure to choose the client.conf!

Then you'll add this script, to start after the system booted.
Do this in the terminal:

update-rc.d OnBootOpvenvpn.sh defaults

It might say hes missing headers. You can ignore that for now.
I'm not sure what "defaults" does, I think it means to start as a "normal" programm, after finishing booting and doing deep System stuff.

share|improve this answer
    
when I ran the first command you posted (openvpn <path>/server.conf) I received the following error: "WARNING: Failed running command (--up/--down): external program fork failed" - this is a good thing, I now have something to research. I'm looking it up online, will report back when I find something or hit a roadblock. –  wahwahsoserious Nov 14 '12 at 23:54
    
Sounds strange.. I've never heard of it! Have luck finding the answer! –  zwarag Nov 18 '12 at 17:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.