[libvirt PATCH 07/11] systemd: Introduce systemd_service_oomscoreadjust_extra

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Andrea Bolognani <abologna@xxxxxxxxxx>
---
 src/locking/meson.build                   | 1 +
 src/locking/virtlockd.service.in          | 4 ----
 src/logging/meson.build                   | 1 +
 src/logging/virtlogd.service.in           | 4 ----
 src/meson.build                           | 1 +
 src/virtd.service.oomscoreadjust.extra.in | 5 +++++
 6 files changed, 8 insertions(+), 8 deletions(-)
 create mode 100644 src/virtd.service.oomscoreadjust.extra.in

diff --git a/src/locking/meson.build b/src/locking/meson.build
index f3bdf57483..d15e2cb84a 100644
--- a/src/locking/meson.build
+++ b/src/locking/meson.build
@@ -145,6 +145,7 @@ if conf.has('WITH_LIBVIRTD')
     'service': 'virtlockd',
     'service_in': files('virtlockd.service.in'),
     'service_extra_in': [
+      systemd_service_oomscoreadjust_extra_in,
       systemd_service_limitnofile_extra_in,
     ],
     'name': 'locking',
diff --git a/src/locking/virtlockd.service.in b/src/locking/virtlockd.service.in
index 5c374fea8f..cd6c77c6af 100644
--- a/src/locking/virtlockd.service.in
+++ b/src/locking/virtlockd.service.in
@@ -13,10 +13,6 @@ Environment=VIRTLOCKD_ARGS=
 EnvironmentFile=-@initconfdir@/virtlockd
 ExecStart=@sbindir@/virtlockd $VIRTLOCKD_ARGS
 ExecReload=/bin/kill -USR1 $MAINPID
-# Losing the locks is a really bad thing that will
-# cause the machine to be fenced (rebooted), so make
-# sure we discourage OOM killer
-OOMScoreAdjust=-900
 
 [Install]
 WantedBy=multi-user.target
diff --git a/src/logging/meson.build b/src/logging/meson.build
index a3d0ad297c..fbf492b16e 100644
--- a/src/logging/meson.build
+++ b/src/logging/meson.build
@@ -92,6 +92,7 @@ if conf.has('WITH_LIBVIRTD')
     'service': 'virtlogd',
     'service_in': files('virtlogd.service.in'),
     'service_extra_in': [
+      systemd_service_oomscoreadjust_extra_in,
       systemd_service_limitnofile_extra_in,
     ],
     'name': 'logging',
diff --git a/src/logging/virtlogd.service.in b/src/logging/virtlogd.service.in
index 9108dd1ff9..569c9f88ad 100644
--- a/src/logging/virtlogd.service.in
+++ b/src/logging/virtlogd.service.in
@@ -13,10 +13,6 @@ Environment=VIRTLOGD_ARGS=
 EnvironmentFile=-@initconfdir@/virtlogd
 ExecStart=@sbindir@/virtlogd $VIRTLOGD_ARGS
 ExecReload=/bin/kill -USR1 $MAINPID
-# Losing the logs is a really bad thing that will
-# cause the machine to be fenced (rebooted), so make
-# sure we discourage OOM killer
-OOMScoreAdjust=-900
 
 [Install]
 WantedBy=multi-user.target
diff --git a/src/meson.build b/src/meson.build
index 611f05583d..29c37a030a 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -197,6 +197,7 @@ guest_unit_files = []
 systemd_service_limitnofile_extra_in = files('virtd.service.limitnofile.extra.in')
 systemd_service_taskmax_extra_in = files('virtd.service.tasksmax.extra.in')
 systemd_service_limitmemlock_extra_in = files('virtd.service.limitmemlock.extra.in')
+systemd_service_oomscoreadjust_extra_in = files('virtd.service.oomscoreadjust.extra.in')
 
 # virt_daemon_units:
 #   generate libvirt daemon systemd unit files
diff --git a/src/virtd.service.oomscoreadjust.extra.in b/src/virtd.service.oomscoreadjust.extra.in
new file mode 100644
index 0000000000..53b93efda8
--- /dev/null
+++ b/src/virtd.service.oomscoreadjust.extra.in
@@ -0,0 +1,5 @@
+[Service]
+# Losing this daemon is a really bad thing that will
+# cause the machine to be fenced (rebooted), so make
+# sure we discourage OOM killer
+OOMScoreAdjust=-900
-- 
2.41.0




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux