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:
Which then looks for:
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.