【问题标题】:Debian 8 openvpn init script ignoring config fileDebian 8 openvpn 初始化脚本忽略配置文件
【发布时间】:2016-04-18 01:22:59
【问题描述】:

当我使用“/etc/openvpn”中的“openvpn server.conf”运行 openvpn 时,一切正常。但是当我运行 '/etc/init.d/openvpn start' 或 '/etc/init.d/openvpn start server' 或 '/etc/init.d/openvpn start server.conf' 时 server.conf 配置文件被忽略. 为什么?

希望有人可以帮助我。

问候。

【问题讨论】:

  • 最好在serverfault.com上提问。
  • @RoryJaffe:谢谢你的通知,我不知道。将在 serverfault.com 上询问下一个问题。不是“谢谢”四次减分票;)。

标签: debian init openvpn


【解决方案1】:

首先要检查的是 systemd 状态(如果我没记错的话,Debian 8 正在使用 systemd 运行)。

所以你可以这样做:systemctl status openvpn 并检查输出。

  1. Active: active (running) => 在这里没有多大帮助
  2. Active: active (exited) => 已正常启动并无错误退出,常见原因可能是找不到配置文件。
  3. 活动:失败(结果:退出代码)=> 它已启动并因错误而失败。那么您可以执行 journalctl -xe 并检查消息。

让我们知道结果。

【讨论】:

  • 你好弗洛伦特,谢谢你的回答。 systemctl status openvpn 导致:Active: active (exited)。顺便说一句,我以 root 身份运行所有这些命令。 server.conf 拥有 root 作为所有者:组 rw 为所有者,r 为组。
  • 我又来了。我在我的客户端(raspbian)上测试了相同的命令。 /etc/init.d/openvpn start 在那里工作正常。 systemctl status openvpn 也会产生 Active: active (exited)。而ps aux | grep openvpn 的结果是/usr/sbin/openvpn --daemon ovpn-client --status /run/openvpn/client.status 10 --cd /etc/openvpn --config /etc/openvpn/client.conf。所以我看到,client.conf 被发现并被使用。服务器端的ps aux | grep openvpn 什么也没有显示。
  • 您在 /etc/openvpn/ 中有多个配置文件 (*.conf) 吗?
  • 不,我不知道。找到了解决方案。看我的回答。
  • 是的,我的回答暗示了这一点,我虽然你会尝试玩 systemctl...
【解决方案2】:

终于找到了解决办法。 而不是使用/etc/init.d/openvpn restart,您可以使用

service openvpn restart

systemctl restart openvpn.service

启动/停止/重新启动/重新加载服务。 https://stackoverflow.com/a/28930361/6217547 引导我找到了这个解决方案。

【讨论】:

    猜你喜欢
    • 2017-04-13
    • 2017-01-22
    • 1970-01-01
    • 2018-10-14
    • 1970-01-01
    • 2021-12-08
    • 1970-01-01
    • 1970-01-01
    • 2016-11-04
    相关资源
    最近更新 更多