testsAndMisc/linux_configuration/scripts/periodic_background/system-maintenance/systemd/monitors.slice
Krzysztof kuhy Rudnicki 42a66a1419 refactor(linux_configuration/scripts): split all scripts into single_use/ and periodic_background/
- Move all linux_configuration scripts into two semantic categories:
  - single_use/: scripts run once manually (fresh install, fixes, setup)
  - periodic_background/: scripts run by systemd timers or daemons
- Preserve existing subdirectory structure within each category
- Fix lib/common.sh source paths for new directory depths
- Fix CONFIG_DIR depth in setup_periodic_system.sh and check_and_enable_services.sh
- Update all references in tests, fresh-install/main.sh, nix modules, and docs
- Fix check_polling_antipatterns.sh false positives (||, regex |, case patterns, jq strings)
- Fix pre-existing mypy exclusion path and type annotations for moved tools/ directory
- Rewrite check_polling_antipatterns.sh using awk (no bash regex loops); add require_serial: true
2026-05-15 00:32:35 +02:00

21 lines
801 B
SYSTEMD

[Unit]
Description=Resource-capped slice for user monitoring / status-bar scripts
Documentation=https://www.freedesktop.org/software/systemd/man/systemd.slice.html
[Slice]
# Cap the entire slice at 50% of one CPU and 512 MiB of RAM. If i3blocks or
# any other status-bar tooling enters a fork-storm regime (as was observed
# when polling scripts forked awk/tr/grep/bc every tick), the kernel will
# throttle the slice rather than let it eat the box.
CPUQuota=50%
# MemorySwapMax=0 is required on systems with zram: without it, a cgroup
# hitting MemoryMax thrashes zram instead of being OOM-killed, freezing
# the machine. See .github/skills/oom-prevention/SKILL.md.
MemoryMax=512M
MemorySwapMax=0
TasksMax=256
# Make sure killing the slice reaps every descendant.
[Install]
WantedBy=default.target