systemd: Introduce systemd_service_oomscoreadjust_extra_in

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Andrea Bolognani 2023-09-28 12:17:58 +02:00
parent 5c83da1dfd
commit 28b85e0374
6 changed files with 8 additions and 8 deletions

View File

@ -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',

View File

@ -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

View File

@ -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',

View File

@ -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

View File

@ -197,6 +197,7 @@ guest_unit_files = []
systemd_service_limitnofile_extra_in = files('virtd.service.limitnofile.extra.in')
systemd_service_tasksmax_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

View File

@ -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