简体   繁体   English

Debian 8 openvpn初始化脚本忽略配置文件

[英]Debian 8 openvpn init script ignoring config file

when I run openvpn with 'openvpn server.conf' from '/etc/openvpn' everything works fine. 当我从'/ etc / openvpn'中使用'openvpn server.conf'运行openvpn时,一切正常。 But when i run '/etc/init.d/openvpn start' or '/etc/init.d/openvpn start server' or '/etc/init.d/openvpn start server.conf' the server.conf configfile is ignored. 但是当我运行'/etc/init.d/openvpn start'或'/etc/init.d/openvpn start server'或'/etc/init.d/openvpn start server.conf'时,server.conf配置文件将被忽略。 Why? 为什么?

Hope someone can help me. 希望可以有人帮帮我。

Regards. 问候。

First thing to check is systemd status (Debian 8 is running with systemd if I'm correct). 首先要检查的是systemd状态(如果我正确的话,Debian 8正在使用systemd运行)。

So you can do: systemctl status openvpn and check the output. 因此,您可以执行以下操作: systemctl status openvpn并检查输出。

  1. Active: active (running) => here it doesn't help much 主动:主动(运行)=>此处并没有太大帮助
  2. Active: active (exited) => it has been started properly and exited with no error, common reason could be that there is no config file found. 活动:活动(退出)=>它已正确启动,并且没有错误退出,常见原因可能是找不到配置文件。
  3. Active: failed (Result: exit-code) => it has been started and failed with error. 活动:失败(结果:退出代码)=>它已启动,并因错误而失败。 THen you can do a journalctl -xe and check the messages. 然后,您可以执行journalctl -xe并检查消息。

Let us know the result of this. 让我们知道结果。

Finally I found a solution. 终于我找到了解决方案。 Instead of using /etc/init.d/openvpn restart you can use 您可以使用/etc/init.d/openvpn restart来代替

service openvpn restart or service openvpn restart

systemctl restart openvpn.service

to start/stop/restart/reload services. 启动/停止/重新启动/重新加载服务。 https://stackoverflow.com/a/28930361/6217547 led me to this solution. https://stackoverflow.com/a/28930361/6217547使我想到了这个解决方案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM