Signal9Signal9 — home
online
back to labs

systemd: Cap a Service with CPUQuota, MemoryMax, and Nice

MediumRHCSA Prep15-25 min
The brief

A runaway batch service is starving interactive work. Constrain it with a systemd drop-in (don't edit the unit directly). Your assignment is in /root/case/assignment.env (SERVICE, CPU_QUOTA, MEMORY_MAX, NICE).

Create /etc/systemd/system/SERVICE.service.d/override.conf:

`

[Service]

CPUQuota=CPU_QUOTA

MemoryMax=MEMORY_MAX

Nice=NICE

`

systemctl edit SERVICE creates this file for you. Grading reads the drop-in (systemd need not be running). See /root/case/brief.txt.

What you'll do
  • Add a systemd drop-in without editing the unit
  • Cap CPU with CPUQuota (a cgroup limit)
  • Cap memory with MemoryMax (a cgroup limit)
  • Lower scheduling priority with Nice

Hands-on lab: you work on a real Linux box in your browser, graded on the machine's actual state.