From: "cron2 (Code Review)" Date: Sat, 14 Mar 2026 10:50:06 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: <6ecc032f767ac8af89e3ff6cc42dac00dcf0f2b5-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="T4fkzbgkK1Y="; charset=UTF-8 Subject: [Openvpn-devel] [XS] Change in openvpn[master]: systemd: Change LimitNPROC to TasksMax and increase limit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: flichtenheld Cc: plaisthos , openvpn-devel --T4fkzbgkK1Y= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/15= 39?usp=3Demail ) Change subject: systemd: Change LimitNPROC to TasksMax and increase limit ...................................................................... systemd: Change LimitNPROC to TasksMax and increase limit There were some complaints about valid setups that ran into problems with LimitNPROC. This is especially true since LimitNPROC limits the total amounts of threads running for the same uid, so if multiple openvpn services run under the same user, they will compete for resources. As suggested in the systemd documentation change this to TasksMax which really counts the threads running in one specific service. Also increase the limit. When using e.g. resolvconf for DNS configuration the limit can be exhausted just due to the amount of nested shell scripts. Github: Fixes OpenVPN/openvpn#929 Change-Id: Ic877f9a9c6459c6eb97cde1099f47f0b196b8084 Signed-off-by: Frank Lichtenheld Acked-by: Gert Doering Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1539 Message-Id: <20260313223833.3813-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36= 123.html Signed-off-by: Gert Doering --- M distro/systemd/openvpn-client@...2221... M distro/systemd/openvpn-server@...2221... 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/distro/systemd/openvpn-client@...2221... b/distro/systemd/open= vpn-client@...2221... index 326bb73..340603e 100644 --- a/distro/systemd/openvpn-client@...2221... +++ b/distro/systemd/openvpn-client@...2221... @@ -12,7 +12,7 @@ WorkingDirectory=3D/etc/openvpn/client ExecStart=3D@...2235...@/openvpn --suppress-timestamps --nobind --config %i.c= onf CapabilityBoundingSet=3DCAP_IPC_LOCK CAP_NET_ADMIN CAP_NET_RAW CAP_SETGID = CAP_SETUID CAP_SETPCAP CAP_SYS_CHROOT CAP_DAC_OVERRIDE CAP_SYS_NICE -LimitNPROC=3D10 +TasksMax=3D20 DeviceAllow=3D/dev/null rw DeviceAllow=3D/dev/net/tun rw ProtectSystem=3Dtrue diff --git a/distro/systemd/openvpn-server@...2221... b/distro/systemd/open= vpn-server@...2221... index d43bce1..3462f33 100644 --- a/distro/systemd/openvpn-server@...2221... +++ b/distro/systemd/openvpn-server@...2221... @@ -12,7 +12,7 @@ WorkingDirectory=3D/etc/openvpn/server ExecStart=3D@...2235...@/openvpn --status %t/openvpn-server/status-%i.log --s= tatus-version 2 --suppress-timestamps --config %i.conf CapabilityBoundingSet=3DCAP_IPC_LOCK CAP_NET_ADMIN CAP_NET_BIND_SERVICE CA= P_NET_RAW CAP_SETGID CAP_SETUID CAP_SETPCAP CAP_SYS_CHROOT CAP_DAC_OVERRIDE= CAP_SYS_NICE CAP_AUDIT_WRITE -LimitNPROC=3D10 +TasksMax=3D20 DeviceAllow=3D/dev/null rw DeviceAllow=3D/dev/net/tun rw ProtectSystem=3Dtrue -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1539?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings?usp=3Demail Gerrit-MessageType: merged Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: Ic877f9a9c6459c6eb97cde1099f47f0b196b8084 Gerrit-Change-Number: 1539 Gerrit-PatchSet: 3 Gerrit-Owner: flichtenheld Gerrit-Reviewer: cron2 Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel --T4fkzbgkK1Y= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 sub= mitted this change.

View Change

systemd: Change LimitNPROC to TasksMax and incre=
ase limit

There were some complaints about valid setups
that ran = into problems with LimitNPROC. This
is especially true since LimitNPROC = limits
the total amounts of threads running for the
same uid, so if m= ultiple openvpn services run
under the same user, they will compete for<= br>resources. As suggested in the systemd
documentation change this to T= asksMax which
really counts the threads running in one
specific servi= ce.

Also increase the limit. When using e.g.
resolvconf for DNS c= onfiguration the limit
can be exhausted just due to the amount of
nes= ted shell scripts.

Github: Fixes OpenVPN/openvpn#929
Change-Id: I= c877f9a9c6459c6eb97cde1099f47f0b196b8084
Signed-off-by: Frank Lichtenhel= d <frank@...2641...>
Acked-by: Gert Doering <gert@...1296...>= ;
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1539
Message-Id:= <20260313223833.3813-1-gert@...1296...>
URL: https://www.mail-arc= hive.com/openvpn-devel@lists.sourceforge.net/msg36123.html
Signed-off-by= : Gert Doering <gert@...1296...>
---
M distro/systemd/openvpn-c= lient@...2221...
M distro/systemd/openvpn-server@...2221...
2 files c= hanged, 2 insertions(+), 2 deletions(-)

diff --git a/distro/systemd/openvpn-client@...2221... b/distro/systemd/o=
penvpn-client@...2221...
index 326bb73..340603e 100644
--- a/distro/systemd/openvpn-client@...2221...
= +++ b/distro/systemd/openvpn-client@...2221...
@@ -12,7 +12= ,7 @@
WorkingDirectory=3D/etc/openvpn/client
ExecStart=3D@...2235...@/openvpn --suppress-timestamps --nobind --config %= i.conf

CapabilityBoundingSet=3DCAP_IPC_LOCK CAP_NET_ADMIN = CAP_NET_RAW CAP_SETGID CAP_SETUID CAP_SETPCAP CAP_SYS_CHROOT CAP_DAC_OVERRI= DE CAP_SYS_NICE
-LimitN= PROC=3D10
+TasksMax= =3D20
DeviceAllow=3D/dev/null rw
DeviceAl= low=3D/dev/net/tun rw
ProtectSystem=3Dtrue
diff --git a/distro/systemd/openvpn-server@...2221... b/distro/systemd/ope= nvpn-server@...2221...
index d43bce1..3462f33 100644=
--- a/distro/systemd/openvpn-server@...2221...
++= + b/distro/systemd/openvpn-server@...2221...
@@ -12,7 +12,7= @@
WorkingDirectory=3D/etc/openvpn/server
ExecStart=3D@...2235...@/openvpn --status %t/openvpn-server/status-%i.log --= status-version 2 --suppress-timestamps --config %i.conf
Ca= pabilityBoundingSet=3DCAP_IPC_LOCK CAP_NET_ADMIN CAP_NET_BIND_SERVICE CAP_N= ET_RAW CAP_SETGID CAP_SETUID CAP_SETPCAP CAP_SYS_CHROOT CAP_DAC_OVERRIDE CA= P_SYS_NICE CAP_AUDIT_WRITE
-LimitNPROC=3D10
= +TasksMax=3D20
DeviceAllow=3D/dev/null rw
= DeviceAllow=3D/dev/net/tun rw
ProtectSystem=3Dtrue=

To view, visit change 1539. To unsubscribe, or fo= r help writing mail filters, visit settings.

Gerrit-MessageType: merged
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ic877f9a9c6459c6eb97cde1099f= 47f0b196b8084
Gerrit-Change-Number: 1539
Gerrit-PatchSet: 3
Gerrit-Owner: flichtenheld <frank@...2723...= .>
Gerrit-Reviewer: cron2 <gert@...1296...>=
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
= --T4fkzbgkK1Y=--