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

Not seeing OpenVPN running or errors

· 52CE 我爱测

systemctl status openvpn ● openvpn.service - OpenVPN service Loaded: loaded (/lib/systemd/system/openvpn.service; enabled) Active: active (exited) since Thu 2017-02-16 15:11:44 EST; 22h ago Process: 29607 ExecStart=/bin/true (cod…

问题原文

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

 systemctl status openvpn
● openvpn.service - OpenVPN service
   Loaded: loaded (/lib/systemd/system/openvpn.service; enabled)
   Active: active (exited) since Thu 2017-02-16 15:11:44 EST; 22h ago
  Process: 29607 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
 Main PID: 29607 (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/openvpn.service

and

Feb 16 15:11:44 server.local systemd[1]: Started OpenVPN service.
Feb 16 15:15:20 server.local systemd[1]: Started OpenVPN service.
Feb 16 15:15:47 server.local systemd[1]: Started OpenVPN service.
Feb 16 15:22:37 server.local systemd[1]: Started OpenVPN service.
Feb 16 15:23:44 server.local systemd[1]: Started OpenVPN service.
Feb 17 13:36:16 server.local systemd[1]: Started OpenVPN service.

and

I've looked in /var/log/syslog and don't see anything. I've checked in /etc/openvpn for logs and nothing.

Config:

local 0.0.0.0
port 1194
proto udp
dev tun
ca ca.crt
cert server.crt
key server.key
dh dh2048.pem
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "redirect-gateway def1 bypass-dhcp"
push "dhcp-option DNS 208.67.222.222"
push "dhcp-option DNS 208.67.220.220"
client-to-client
duplicate-cn
keepalive 10 120
comp-lzo
max-clients 100
user root
group root
persist-key
persist-tun
status openvpn-status.log
log         openvpn.log
log-append  openvpn.log
verb 9
mute 20

How can I figure out why it will not start?

This is:

cat /etc/debian_version
8.7

已采纳解答

原帖链接 · Jon Archon · CC BY-SA 3.0

Like nearly every other of systemctl's .service files, one can find the relevant openvpn .service files in /lib/systemd/system.

As explained by openvpn's service file located at /lib/systemd/system/openvpn.service:

# This service is actually a systemd target,
# but we are using a service since targets cannot be reloaded.

One instead finds the proper .service file in openvpn@.service, indicating that he should start the openvpn service under his desired user with systemctl start [email omitted] and enable the openvpn service with systemctl enable [email omitted].

The default openvpn@.service loads its configuration from /etc/openvpn/whicheveruser.conf. If one wants to change this, perhaps to /etc/openvpn/server.conf, he should alter openvpn@.service's ExecStart command to his preference.

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

资料来源与适用范围

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

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

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