Skip to content
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

Problem running on OpenVZ #129

Closed
karl-j opened this issue Nov 28, 2017 · 9 comments
Closed

Problem running on OpenVZ #129

karl-j opened this issue Nov 28, 2017 · 9 comments
Labels

Comments

@karl-j
Copy link

karl-j commented Nov 28, 2017

Error:
Job for openvpn@server.service failed because the control process exited with error code. See "systemctl status openvpn@server.service" and "journalctl -xe" for details.

Output of systemctl status openvpn@server.service:

Nov 28 11:58:51 Basic systemd[1]: Starting OpenVPN connection to server...
Nov 28 11:58:51 Basic ovpn-server[30414]: OpenVPN 2.3.10 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [EPOLL] [PKCS11] [MH] [IPv6] built on 
Nov 28 11:58:51 Basic ovpn-server[30414]: library versions: OpenSSL 1.0.2g  1 Mar 2016, LZO 2.08
Nov 28 11:58:51 Basic ovpn-server[30414]: daemon() failed or unsupported: Resource temporarily unavailable (errno=11)
Nov 28 11:58:51 Basic ovpn-server[30414]: Exiting due to fatal error
Nov 28 11:58:51 Basic systemd[1]: openvpn@server.service: Control process exited, code=exited status=1
Nov 28 11:58:51 Basic systemd[1]: Failed to start OpenVPN connection to server.
Nov 28 11:58:51 Basic systemd[1]: openvpn@server.service: Unit entered failed state.
Nov 28 11:58:51 Basic systemd[1]: openvpn@server.service: Failed with result 'exit-code'.

OS: Ubuntu 16.04 x64 running on OpenVZ

Workaround:

  1. comment out the LimitNPROC line in /lib/systemd/system/openvpn@.service
  2. systemctl daemon-reload

Credits:

@angristan
Copy link
Owner

Thanks for the issue. There was the same issue with Debian 9.

Could you try this branch? https://github.com/Angristan/OpenVPN-install/blob/systemd-openvz-fix/openvpn-install.sh

@angristan angristan added the bug label Nov 28, 2017
@michaelfresco
Copy link

@angristan
Off topic, but the the link to the branch you posted, SOLVED ALL MY PROBLEMS! - I spent 6 hours on getting OpenVPN to work. You are my hero! :)

@angristan
Copy link
Owner

@michaelfresco Nice to hear, were you using OpenVZ?

@michaelfresco
Copy link

michaelfresco commented Dec 6, 2017

@angristan Yes, I was using OpenVZ. All the time I could not get traffic through openvpn, even though I did successfully connect to it. It was a major headache honestly. I tried to ping 8.8.4.4, but got no relpy. The script from the systemmd-openvz branch fixed it all though! Real magic!

@angristan
Copy link
Owner

@michaelfresco Thanks for the feedback! What os are you using BTW?

@michaelfresco
Copy link

@angristan Debian GNU/Linux 8.9 (jessie). With uname -r: 2.6.32-042stab116.2 (OpenVZ)

@angristan
Copy link
Owner

@michaelfresco ok, thanks

@angristan
Copy link
Owner

No news from @karl-j, I merged #139 so please re-open this if it doesn't fix it

@StuckUpCreations
Copy link

Error:
Job for openvpn@server.service failed because the control process exited with error code. See "systemctl status openvpn@server.service" and "journalctl -xe" for details.

Output of systemctl status openvpn@server.service:

Nov 28 11:58:51 Basic systemd[1]: Starting OpenVPN connection to server...
Nov 28 11:58:51 Basic ovpn-server[30414]: OpenVPN 2.3.10 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [EPOLL] [PKCS11] [MH] [IPv6] built on 
Nov 28 11:58:51 Basic ovpn-server[30414]: library versions: OpenSSL 1.0.2g  1 Mar 2016, LZO 2.08
Nov 28 11:58:51 Basic ovpn-server[30414]: daemon() failed or unsupported: Resource temporarily unavailable (errno=11)
Nov 28 11:58:51 Basic ovpn-server[30414]: Exiting due to fatal error
Nov 28 11:58:51 Basic systemd[1]: openvpn@server.service: Control process exited, code=exited status=1
Nov 28 11:58:51 Basic systemd[1]: Failed to start OpenVPN connection to server.
Nov 28 11:58:51 Basic systemd[1]: openvpn@server.service: Unit entered failed state.
Nov 28 11:58:51 Basic systemd[1]: openvpn@server.service: Failed with result 'exit-code'.

OS: Ubuntu 16.04 x64 running on OpenVZ

Workaround:

1. comment out the LimitNPROC line in /lib/systemd/system/openvpn@.service

2. systemctl daemon-reload

Credits:

* [lxc/lxd#3336](https://github.com/lxc/lxd/issues/3336)

* https://askubuntu.com/questions/747023/systemd-fails-to-start-openvpn-in-lxd-managed-16-04-container/747146#747146

* https://askubuntu.com/questions/798221/openvpn-in-lxc-failed-to-set-devices-allow

just installed debian 9 on a openvz server and can confirm commenting this line out fixes this issue :) i will conect later with my client to confirm data flow and everything is corret, but atleast now the openvpn@server service started :)

HenryNe added a commit to HenryNe/openvpn-install that referenced this issue Mar 26, 2020
On Debian 9 the unit file openvpn-server@.service must use and modyfy for OpenVZ. The file openvpn@.service does not work.
HenryNe added a commit to HenryNe/openvpn-install that referenced this issue Mar 27, 2020
On Debian 9 the copy of unit file `/etc/systemd/system/openvpn@.service` has no effect, see angristan#583.
Same problem as angristan#129 and angristan#378, unit can not start on OpenVZ. 

There must execute `systemctl enable` before `systemctl restart`.
So the new link to `/etc/systemd/system/openvpn@.service` was created before `systemctl restart`.
angristan pushed a commit that referenced this issue Mar 28, 2020
On Debian 9 the copy of unit file `/etc/systemd/system/openvpn@.service` has no effect, see #583.
Same problem as #129 and #378, unit can not start on OpenVZ. 

It must execute `systemctl enable` before `systemctl restart`.
So the new link to `/etc/systemd/system/openvpn@.service` was created before `systemctl restart`.
angristan pushed a commit that referenced this issue Mar 28, 2020
On Debian 9 the copy of unit file `/etc/systemd/system/openvpn@.service` has no effect, see #583.
Same problem as #129 and #378, unit can not start on OpenVZ.

It must execute `systemctl enable` before `systemctl restart`.
So the new link to `/etc/systemd/system/openvpn@.service` was created before `systemctl restart`.

Fix #583
timbo2k pushed a commit to timbo2k/openvpn-install that referenced this issue Dec 25, 2021
On Debian 9 the copy of unit file `/etc/systemd/system/openvpn@.service` has no effect, see angristan#583.
Same problem as angristan#129 and angristan#378, unit can not start on OpenVZ.

It must execute `systemctl enable` before `systemctl restart`.
So the new link to `/etc/systemd/system/openvpn@.service` was created before `systemctl restart`.

Fix angristan#583
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants