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.

When I start openvpn on the server with:

sudo openvpn /etc/openvpn/server.conf 

It works and I can connect my client to it.

When I start it with:

sudo /etc/init.d/openvpn start

It appears to work as I see:

* Starting virtual private network daemon(s)...
*   Autostarting VPN 'openvpn': missing /etc/openvpn/openvpn.conf file !

But I cannot connect the client to it.

Checking the port shows it as "closed" (in the sense that nothing is listening there... it is not closed by the firewall) in the latter case while "open" in the former.

So where is the disconnect? Is init.d not starting what I thought it would? Is it not loading the correct conf file (but then why do I not need to load openvpn.conf when I start the server directly)? Am I missing a parameter somewhere?


EDIT: Reason behind the solution

Examining the init.d script as suggested by JeffG showed it was getting the $NAME of the conf file from:

NAME=${NAME%%.pid}

Which then looks for:

$CONFIG_DIR/$NAME.conf

This made: NAME=openvpn so then the script went looking for openvpn.conf which does not exist as I named the file server.conf (which is how the instructions on the openvpn site say to name the file). Simply copying that file over to be named as the init.d script wanted (Hyppy's solution) fixed the problem.

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

Try this:

sudo cp /etc/openvpn/server.conf /etc/openvpn/openvpn.conf
share|improve this answer
    
Bingo. That did it. Thanks! –  Lothar_Grimpsenbacher Mar 21 '11 at 21:40
add comment

Check you init.d script. Ensure that it is using /etc/openvpn/server.conf for configuration

share|improve this answer
    
I wish I could vote two answers up as, while Hyppy's answer satisfied my immediate problem, your answer helped me see why. Turns out the init.d script was getting the name of the conf file from the PID of openvpn. That being 'openvpn' and there was no openvpn.conf so it was not working properly. Thanks for the input though, I appreciate the assistance. –  Lothar_Grimpsenbacher Mar 21 '11 at 21:42
add comment

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.