大网数据广告活动
服务器运维问答

OpenVPN won't start as a service with config file

· 52CE 我爱测

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…

问题原文

原帖链接 · jfreak53 · CC BY-SA 3.0

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:

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.

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:

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]: [email omitted]: Unit entered failed state.
Jan 11 14:31:37 cloud systemd[1]: [email omitted]: 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]: [email omitted]: 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]: [email omitted]: Unit entered failed state.
Jan 11 16:06:07 cloud systemd[1]: [email omitted]: 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]: [email omitted]: 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]: [email omitted]: Unit entered failed state.
Jan 12 09:55:35 cloud systemd[1]: [email omitted]: Failed with result 'exit-code'.

已采纳解答

原帖链接 · multithr3at3d · CC BY-SA 3.0

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.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2018-01-11)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。