-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VPN reconnect when connection closes #61
Comments
Ok, so... The container starts openvpn and as long as the openvpn-process is running the container is quite happy. I don't want to implement a lot of functionality trying to check the openvpn connection for special cases. This should be handled by openvpn. Suggestion: As it states in the the docs:
If you use this along with the --restart=always option for the One question though... You say that transmission stops all transfers when you have a vpn disconnect. Are they actually stopped? Or does Transmission die? I.e; can you still access the WebUI? Could you paste some logs of what happens during a disconnect? PS: They also have a --ping-restart option, but I'm not sure if this lets you skip the --restart=always on the container. If openvpn stops, the container stops. So it depends on how openvpn behaves. Try it first if you'd like, could be interesting to know if the --restart=always could be dropped. |
Hi, thanks for your response!
I will report back with my findings. Thank you so much! |
Ad 2.): The container has restarted itself twice now in 48 hours so I believe the ping/exist test is working fine via OPENVPN_OPTS. So far so good! This appears more elegant than my previous cronned stop/restart mechanism. I will try 3.) next. |
Good stuff 👍 |
Ok, so I tried the --ping-restart option and it doesn't work as hoped. Right now, in my 2 day old container it appears the VPN connection dropped, so openvpn would need to be restarted. I can attach a bash shell to the container and
This appears to be a bug in openvpn!? I can't ping outside IPs, but it does not seem to restart the openvpn connection. |
Maybe. Openvpn has a lot of users, something tells me they would have caught it. Thanks for exploring! I'll put something in the readme about the ping-exit option. |
Hmmm last night the container DID reset with ping-restart, so this time it worked as expected. I don't understand this. It appears sometimes it seems to get stuck, then next time it works fine with the exact same parameters. Do you know where I can find the Openvpn logs inside the container? |
Don't know where they go by default. But looks like you can set a --log option and specify it. |
Ok I think I found the issue. The OpenVPN definition file for my provider (PureVPN) used a host name such as "at1.pointtoserver.com" to reach the VPN server. Now when the connection died I found a DNS error in the logs "Unable to resolve at1.pointtoserver.com". So a week ago I changed "at1.pointtoserver.com" in the OpenVPN definition file to the corresponding numeric IP address. Since then the container restarted itself twice without hickups so far and always stayed responsive. So Im crossing my fingers that this was the problem: OpenVPN couldn't reach the DNS service to resolve the hostname to use the --ping command. With a numeric IP it appears to be able to attempt to reach the IP, and in case it can't ping it, it will restart the container. Maybe you want to include this in a FAQ, maybe this will be helpful to some people. |
Aha, so the container loses dns and then it doesn't matter if the "--ping-restart" restarts the openvpn process because the container can't resolve the hostname anyways. But if you have "--ping-exit" the container will stop when the dns issues occur and then the container will be started again, probably refreshing or fixing dns setting. I guess I'll link to this issue from the README and propose the --ping-exit as the most robust option. A few extra container restarts shouldn't be a problem ;) Thanks for coming back with an explanation, good exploring! 👍 |
Added --ping-exit option to the readme for future reference. |
@makloda asked this question in issue #49.
Moving it here as it is unrelated to the other issue.
The text was updated successfully, but these errors were encountered: