|Component||Checks & Agents|
|Title||systemd: Fixed possible memory leak related to KillMode in unit file|
|Checkmk Edition||Checkmk Raw Edition (CRE)|
|Compatibility||Compatible - 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