OpenVPN on Debian 8
I need help please!
I managed to install and configure OpenVPN 2.3.4 The OpenVPN service does not load during boot because it is loaded before the network is up Code:
Jul 04 04:47:45 osmc systemd[1]: openvpn@server.service: control process exited, code=exited status=1 I read online about editing the openvpn@.service and adding Code:
[Unit] OpenVPN error: Code:
Sat Jul 4 05:36:21 2015 OpenVPN 2.3.4 arm-unknown-linux-gnueabihf [SSL (OpenSSL)] [LZO] [EPOLL] [PKCS11] [MH] [IPv6] built on Dec 1 2014 Code:
Sat Jul 4 05:52:49 2015 OpenVPN 2.3.4 arm-unknown-linux-gnueabihf [SSL (OpenSSL)] [LZO] [EPOLL] [PKCS11] [MH] [IPv6] built on Dec 1 2014 Thanks in advance. |
I'm wondering if it's because nothing else is configured to make sure network is actually up before network-online.target is reached. For those of us who use NetworkManager, there is a NetworkManager-Wait-Online.service that helps with this. (A ConMan-Wait-Online.service would be nice.) Anyway, you could check this with
Code:
systemctl list-dependencies network-online.target --reverse http://unix.stackexchange.com/questi...ng-has-started Some general workarounds... 1. What you could do is write a script called by a custom service that checks that network connectivity has been established, looping until this condition is met. That could use the ordering Code:
Wants=network.target 2. The other possible quick and dirty solution might be to introduce a delay in the execution of the command called by openvpn@server.service using the sleep command for example. |
Quote:
Code:
network-online.target Can you please provide the command to add in the unit file to introduce a delay start with the sleep command? Thanks again. |
ferrari, I was finally able to solve this annoying problem with your guidance.
I investigated the boot log with 'journalctl -b' and noticed after the eth0 was up, the NTP service was started. I simply edit my openvpn@.service and added 'After=ntp.service' and now OpenVPN is loading on every boot. You can also add 'After=multi-user.target' instead as it works too. Many thanks for your help. |
Well done. :)
|
Im sorry, I am somewhat new to Linux as well and I have realized that this is my issue as well. My problem now is, I do not quite understand when you say 'edit openvpn@.service'? Where is that file? How do I edit that and add the new line so when system boots, it starts at the correct time?
|
Okay, I found what I was looking for but it doesn't seem to fix the issue. This is what is happening. Connected to VPN fine, reboot, can't connect, reload VPN, can connect. I thought this topic was exactly the solution and it may be but it doesnt seem to be working. I may be adding it to wrong file or wrong part of file. Help greatly appreciated. Thanks in advance!
|
Quote:
Edit this file with your text editor, in my case I use nano Code:
nano /lib/systemd/system/openvpn@.service Code:
[Unit] |
All times are GMT -5. The time now is 07:50 PM. |