Skip to content

Commit

Permalink
Fix systemd unit issue on Debian 9 (#585)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
HenryNe authored and angristan committed Mar 28, 2020
1 parent 3d075c8 commit 44105eb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions openvpn-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -887,8 +887,8 @@ verb 3" >> /etc/openvpn/server.conf
fi
systemctl daemon-reload
systemctl restart openvpn-server@server
systemctl enable openvpn-server@server
systemctl restart openvpn-server@server
elif [[ "$OS" == "ubuntu" ]] && [[ "$VERSION_ID" == "16.04" ]]; then
# On Ubuntu 16.04, we use the package from the OpenVPN repo
# This package uses a sysvinit service
Expand All @@ -904,8 +904,8 @@ verb 3" >> /etc/openvpn/server.conf
sed -i 's|/etc/openvpn/server|/etc/openvpn|' /etc/systemd/system/openvpn\@.service
systemctl daemon-reload
systemctl restart openvpn@server
systemctl enable openvpn@server
systemctl restart openvpn@server
fi
if [[ $DNS == 2 ]];then
Expand Down

0 comments on commit 44105eb

Please sign in to comment.