We use cookies to ensure that we give you the best experience on our website.  Visit our Privacy Policy to learn more. If you continue to use this site, we will assume that you are okay with it.

Your choices regarding cookies on this site.
Your preferences have been updated.
In order for the changes to take effect completely please clear your browser cookies and cache. Then reload the page.

Werk #10070: systemd: Fixed possible memory leak related to KillMode in unit file

ComponentChecks & Agents
Titlesystemd: Fixed possible memory leak related to KillMode in unit file
Date2019-09-25 09:28:01
Checkmk EditionCheckmk Raw Edition (CRE)
Checkmk Version1.6.0p5,2.0.0i1
LevelTrivial Change
ClassBug Fix
CompatibilityCompatible - no manual interaction needed

We have seen cases in which the parameter "KillMode=process" of the unit file "check_mk@.service" causes a memory leak. This was first seen on Debian Buster but could occur in the future on other operating systems too.

The cached check runs that are forked in the backround seem to cause systemd not to discard the service once it's done. If you run:

root@linux# systemd-cgls -au system-check_mk.slice

you can see a lot of old services and task_struct objects in slab growing constantly. You can see those processes also on eg. Debian Stretch but there they should have no effect on task_struct objects.

To fix this, the parameter "KillMode=process" was changed to "Type=forking".

To change the unit file:

root@linux# systemctl stop check_mk.socket
root@linux# systemctl disable check_mk.socket

Copy the new check_mk@.service unit file to /etc/systemd/system/. You can download the file within "Monitoring Agents" - "Agent files" or find it in site user context ~/share/check_mk/agents/cfg_examples/systemd/.

root@linux# systemctl daemon-reload
root@linux# systemctl enable check_mk.socket
root@linux# systemctl start check_mk.socket