]> xenbits.xensource.com Git - libvirt.git/commitdiff
src: fix max file limits in systemd services
authorDaniel P. Berrangé <berrange@redhat.com>
Wed, 2 Aug 2023 09:00:22 +0000 (10:00 +0100)
committerDaniel P. Berrangé <berrange@redhat.com>
Fri, 4 Aug 2023 12:00:52 +0000 (13:00 +0100)
This fixes

  commit 38abf9c34dc481b0dc923bdab446ee623bdc5ab6
  Author: Daniel P. Berrangé <berrange@redhat.com>
  Date:   Wed Jun 21 13:22:40 2023 +0100

    src: set max open file limit to match systemd >= 240 defaults

The bug referenced in that commit had suggested to set

  LimitNOFile=512000:1024

on the basis that matches current systemd default behaviour and is
compatible with old systemd. That was good except

 * The setting is LimitNOFILE and these are case sensitive
 * The hard and soft limits were inverted - soft must come
   first and so it would have been ignored even if the
   setting name was correct.
 * The default hard limit is 524288 not 512000

Reported-by: Olaf Hering <olaf@aepfle.de>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
src/ch/virtchd.service.in
src/locking/virtlockd.service.in
src/logging/virtlogd.service.in
src/lxc/virtlxcd.service.in
src/qemu/virtqemud.service.in
src/remote/libvirtd.service.in

index be242fea78bb54191fea1a15080d3cc0131a2285..351eee312b4362fe18b1d284837f6e55fab5f10c 100644 (file)
@@ -24,7 +24,7 @@ Restart=on-failure
 # Raise hard limits to match behaviour of systemd >= 240.
 # During startup, daemon will set soft limit to match hard limit
 # per systemd recommendations
-LimitNOFile=512000:1024
+LimitNOFILE=1024:524288
 # The cgroups pids controller can limit the number of tasks started by
 # the daemon, which can limit the number of domains for some hypervisors.
 # A conservative default of 8 tasks per guest results in a TasksMax of
index f1792dcb4394dd549055bf236adaa781a61f75c9..dd0bbab083c500c603d2d5d25d035bdc5447b9c8 100644 (file)
@@ -18,7 +18,7 @@ OOMScoreAdjust=-900
 # Raise hard limits to match behaviour of systemd >= 240.
 # During startup, daemon will set soft limit to match hard limit
 # per systemd recommendations
-LimitNOFile=512000:1024
+LimitNOFILE=1024:524288
 
 [Install]
 Also=virtlockd.socket
index cef4053f591ee4868c225a0bc66bdf5e9bb72a28..8e245ddb43cef4dd820e321fd156dd8cc10288dc 100644 (file)
@@ -18,7 +18,7 @@ OOMScoreAdjust=-900
 # Raise hard limits to match behaviour of systemd >= 240.
 # During startup, daemon will set soft limit to match hard limit
 # per systemd recommendations
-LimitNOFile=512000:1024
+LimitNOFILE=1024:524288
 
 [Install]
 Also=virtlogd.socket
index b615a3f32d98c2d8d1013f9361313844ef86a7cd..ee3a7f1083247738a8c8c3e7593f934b74a55865 100644 (file)
@@ -24,7 +24,7 @@ Restart=on-failure
 # Raise hard limits to match behaviour of systemd >= 240.
 # During startup, daemon will set soft limit to match hard limit
 # per systemd recommendations
-LimitNOFile=512000:1024
+LimitNOFILE=1024:524288
 # The cgroups pids controller can limit the number of tasks started by
 # the daemon, which can limit the number of domains for some hypervisors.
 # A conservative default of 8 tasks per guest results in a TasksMax of
index e3dc738b8f9f7196845b87c15006064c2de7103d..e79670ca95b5c028aed506f50c542eb9244a2988 100644 (file)
@@ -26,7 +26,7 @@ Restart=on-failure
 # Raise hard limits to match behaviour of systemd >= 240.
 # During startup, daemon will set soft limit to match hard limit
 # per systemd recommendations
-LimitNOFile=512000:1024
+LimitNOFILE=1024:524288
 # The cgroups pids controller can limit the number of tasks started by
 # the daemon, which can limit the number of domains for some hypervisors.
 # A conservative default of 8 tasks per guest results in a TasksMax of
index abac58cb2cfc3458d3c33f94d2335ff67f8db9f6..84f1613adc10eb10c350df50b1b6ef087f623cce 100644 (file)
@@ -31,7 +31,7 @@ Restart=on-failure
 # Raise hard limits to match behaviour of systemd >= 240.
 # During startup, daemon will set soft limit to match hard limit
 # per systemd recommendations
-LimitNOFile=512000:1024
+LimitNOFILE=1024:524288
 # The cgroups pids controller can limit the number of tasks started by
 # the daemon, which can limit the number of domains for some hypervisors.
 # A conservative default of 8 tasks per guest results in a TasksMax of