From c703d41795def39b81b4a4ec6b2bda3f144b2a0a Mon Sep 17 00:00:00 2001 From: Angristan Date: Fri, 14 Jul 2017 17:15:07 +0200 Subject: [PATCH] Fix for Debian 9 on OpenVZ --- openvpn-install.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/openvpn-install.sh b/openvpn-install.sh index 4f845c2..3bcd725 100755 --- a/openvpn-install.sh +++ b/openvpn-install.sh @@ -552,7 +552,17 @@ verb 3" >> /etc/openvpn/server.conf if [[ "$OS" = 'debian' ]]; then # Little hack to check for systemd if pgrep systemd-journal; then - systemctl restart openvpn@server.service + if [[ "$VERSION_ID" = 'VERSION_ID="9"' ]]; then + #Workaround to fix OpenVPN service on Debian 9 OpenVZ + sed -i 's|LimitNPROC|#LimitNPROC|' /lib/systemd/system/openvpn-server\@.service + sed -i 's|/etc/openvpn/server|/etc/openvpn|' /lib/systemd/system/openvpn-server\@.service + sed -i 's|%i.conf|server.conf|' /lib/systemd/system/openvpn-server\@.service + systemctl daemon-reload + systemctl restart openvpn-server@openvpn.service + systemctl enable openvpn-server@openvpn.service + else + systemctl restart openvpn@server.service + fi else /etc/init.d/openvpn restart fi