Ubuntu – OpenVPN won’t start as a service with config file

openvpnUbuntu

I've got OpenVPN working good with my config file if I run it from CLI:

openvpn server.conf

But if I try to start it as a service it starts just fine, won't error out, but it will not load my conf file since there is no resulting tun device in ifconfig.

I have AUTOSTART set to all in /etc/init.d/openvpn:

enter image description here

But a quick ifconfig shows it's not started. I know it's not loading my conf file since the log file is not created, but no errors from OpenVPN.

enter image description here

This is on Ubuntu 16.04.3, fresh clean install of OpenVPN.

EDIT

As per comments below I have tried multiple times also with systemctl, it just errors out:

enter image description here
enter image description here

I know the conf file works since I can run it from CLI as openvpn server.conf and it works.

EDIT2

Logs:

Jan 11 14:31:37 cloud systemd[1]: openvpn@server.service: Unit entered failed state.
Jan 11 14:31:37 cloud systemd[1]: openvpn@server.service: Failed with result 'exit-code'.
Jan 11 16:06:07 cloud systemd[1]: Starting OpenVPN connection to server...
Jan 11 16:06:07 cloud ovpn-server[4726]: OpenVPN 2.3.10 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [EPOLL] [PKCS11] [MH] [IPv6] built on Jun 22 2017
Jan 11 16:06:07 cloud ovpn-server[4726]: library versions: OpenSSL 1.0.2g  1 Mar 2016, LZO 2.08
Jan 11 16:06:07 cloud ovpn-server[4726]: daemon() failed or unsupported: Resource temporarily unavailable (errno=11)
Jan 11 16:06:07 cloud ovpn-server[4726]: Exiting due to fatal error
Jan 11 16:06:07 cloud systemd[1]: openvpn@server.service: Control process exited, code=exited status=1
Jan 11 16:06:07 cloud systemd[1]: Failed to start OpenVPN connection to server.
Jan 11 16:06:07 cloud systemd[1]: openvpn@server.service: Unit entered failed state.
Jan 11 16:06:07 cloud systemd[1]: openvpn@server.service: Failed with result 'exit-code'.
Jan 12 09:55:35 cloud systemd[1]: Starting OpenVPN connection to server...
Jan 12 09:55:35 cloud ovpn-server[12133]: Current Parameter Settings:
Jan 12 09:55:35 cloud ovpn-server[12133]:   config = '/etc/openvpn/server.conf'
Jan 12 09:55:35 cloud ovpn-server[12133]:   mode = 1
Jan 12 09:55:35 cloud ovpn-server[12133]:   persist_config = DISABLED
Jan 12 09:55:35 cloud ovpn-server[12133]:   persist_mode = 1
Jan 12 09:55:35 cloud ovpn-server[12133]:   show_ciphers = DISABLED
Jan 12 09:55:35 cloud ovpn-server[12133]:   show_digests = DISABLED
Jan 12 09:55:35 cloud systemd[1]: openvpn@server.service: Control process exited, code=exited status=1
Jan 12 09:55:35 cloud systemd[1]: Failed to start OpenVPN connection to server.
Jan 12 09:55:35 cloud systemd[1]: openvpn@server.service: Unit entered failed state.
Jan 12 09:55:35 cloud systemd[1]: openvpn@server.service: Failed with result 'exit-code'.

Best Answer

This problem is the same as another posted on Ask! Ubuntu. The fix:

What I have found to work is to comment out the LimitNPROC line in /lib/systemd/system/openvpn@.service.