1
0
mirror of https://github.com/Nyr/openvpn-install.git synced 2024-11-27 15:36:07 +03:00

Fix LimitNPROC in containers

See #206 for context.
This commit is contained in:
Nyr 2019-09-06 02:44:17 +02:00
parent 43ef4f920d
commit 1c79a9603b

View File

@ -145,6 +145,7 @@ if [[ -e /etc/openvpn/server/server.conf ]]; then
fi fi
systemctl disable --now openvpn-server@server.service systemctl disable --now openvpn-server@server.service
rm -rf /etc/openvpn/server rm -rf /etc/openvpn/server
rm -f /etc/systemd/system/openvpn-server@server.service.d/disable-limitnproc.conf
rm -f /etc/sysctl.d/30-openvpn-forward.conf rm -f /etc/sysctl.d/30-openvpn-forward.conf
if [[ "$OS" = 'debian' ]]; then if [[ "$OS" = 'debian' ]]; then
apt-get remove --purge -y openvpn apt-get remove --purge -y openvpn
@ -212,6 +213,12 @@ else
echo echo
echo "Okay, that was all I needed. We are ready to set up your OpenVPN server now." echo "Okay, that was all I needed. We are ready to set up your OpenVPN server now."
read -n1 -r -p "Press any key to continue..." read -n1 -r -p "Press any key to continue..."
# If running inside a container, disable LimitNPROC to prevent conflicts
if systemd-detect-virt -cq; then
mkdir /etc/systemd/system/openvpn-server@server.service.d/ 2>/dev/null
echo '[Service]
LimitNPROC=infinity' > /etc/systemd/system/openvpn-server@server.service.d/disable-limitnproc.conf
fi
if [[ "$OS" = 'debian' ]]; then if [[ "$OS" = 'debian' ]]; then
apt-get update apt-get update
apt-get install openvpn iptables openssl ca-certificates -y apt-get install openvpn iptables openssl ca-certificates -y