-
Story
-
Resolution: Duplicate
-
Undefined
-
None
-
rhel-9.0.0
-
None
-
subs-client-tools
-
0
-
False
-
False
-
-
None
-
None
-
None
-
None
-
If docs needed, set a value
-
-
x86_64
-
None
-
57,005
On the RHEL9 Edge VM with `insights-client-3.1.7-6.el9_0.noarch` installed, the `insights-client.service` is trying to set memory limits in the ExecStartPost of the service using the cgroup-v1 hierarchy.
```
$ sudo systemctl cat insights-client.service
- /usr/lib/systemd/system/insights-client.service
- This file is part of insights-client.
# - Any changes made to this file will be overwritten during a software update. To
- override a parameter in this file, create a drop-in file, typically located at
- /etc/systemd/system/insights-client.service.d/override.conf. Put the desired
- overrides in that file and reload systemd. The next time this service is run
- (either manually or via a systemd timer), the overridden values will be in
- effect.
# - For more information about systemd drop-in files, see systemd.unit(5).
[Unit]
Description=Insights Client
Documentation=man:insights-client(8)
After=network.target
[Service]
Type=simple
ExecStart=/usr/bin/insights-client --retry 3
Restart=no
WatchdogSec=900
CPUQuota=30%
MemoryLimit=2G
TasksMax=300
BlockIOWeight=100
ExecStartPost=-/bin/bash -c "echo 2G >/dev/null 2>&1 > /sys/fs/cgroup/memory/system.slice/insights-client.service/memory.memsw.limit_in_bytes"
ExecStartPost=-/bin/bash -c "echo 1G >/dev/null 2>&1 > /sys/fs/cgroup/memory/system.slice/insights-client.service/memory.soft_limit_in_bytes"
```
Since RHEL 9 is mounting the cgroup-v2 hierarchy by default, these commands in the ExecStartPost fields will always fail.
Unfortunately, I am not a cgroup-v2 expert, but I believe that changing the unit file to use the systemd memory options for cgroup-v2 would be the right path forward.
My proposal:
```
$ sudo systemctl cat insights-client.service
- /usr/lib/systemd/system/insights-client.service
- This file is part of insights-client.
# - Any changes made to this file will be overwritten during a software update. To
- override a parameter in this file, create a drop-in file, typically located at
- /etc/systemd/system/insights-client.service.d/override.conf. Put the desired
- overrides in that file and reload systemd. The next time this service is run
- (either manually or via a systemd timer), the overridden values will be in
- effect.
# - For more information about systemd drop-in files, see systemd.unit(5).
[Unit]
Description=Insights Client
Documentation=man:insights-client(8)
After=network.target
[Service]
Type=simple
ExecStart=/usr/bin/insights-client --retry 3
Restart=no
WatchdogSec=900
CPUQuota=30%
MemoryLimit=1G
MemorySwapMax=2G
TasksMax=300
BlockIOWeight=100
```
This does the following:
- removes the ExecStartPost entries
- reduces MemoryLimit to 1G to match the value of `memory.soft_limit_in_bytes` from the removed ExecStartPost command
- adds MemorySwapMax=2G to match the value of `memory.memsw.limit_in_bytes` from the removed ExecStartPost command
I'm not certain that MemoryLimit and MemorySwapMax are direct replacements for the cgroup=-v1 options, but it was the best guess that I made after consulting the Memory Resource Controller docs - https://www.kernel.org/doc/html/latest/admin-guide/cgroup-v1/memory.html#benefits-and-purpose-of-the-memory-controller
NOTE: this change would only be applicable for RHEL9 as RHEL8 still mounts cgroup-v1 by default
- external trackers