Skip to content

Instantly share code, notes, and snippets.

@treblada
Created July 30, 2026 18:39
Show Gist options
  • Select an option

  • Save treblada/824a671b5c2f2f9fb540767237d06ff5 to your computer and use it in GitHub Desktop.

Select an option

Save treblada/824a671b5c2f2f9fb540767237d06ff5 to your computer and use it in GitHub Desktop.
Unifi OS Server (uosserver) / podman / inotify on memory.events fail

I had following warnings every 30 seconds in my /var/log/syslog on a RaspberryPi.

2026-07-30T20:10:13.123478+02:00 pi conmon: conmon f20c2d009a532fdadc23 <nwarn>: Failed to add inotify watch for /sys/fs/cgroup/user.slice/user-1001.slice/user@1001.service/user.slice/libpod-f20c2d009a532fdadc23.scope/container/init.scope/memory.events
2026-07-30T20:10:13.131901+02:00 pi conmon: conmon f20c2d009a532fdadc23 <nwarn>: Failed to open cgroups file: /sys/fs/cgroup/user.slice/user-1001.slice/user@1001.service/user.slice/libpod-f20c2d009a532fdadc23.scope/container/init.scope/memory.events

Here is Claude's analysis and it was right.

Diagnosis — root cause found

The warnings are not a problem with the UniFi container — they're caused by the memory cgroup controller being disabled at the kernel level on your Pi.

Here's the chain of evidence:

  1. Your kernel is booting with cgroup_disable=memory on the command line (visible in /proc/cmdline and confirmed in the boot log): [ 0.000000] cgroup: Disabling memory control group subsystem
  2. Consequently the memory controller is missing everywhere. Root cgroup.controllers shows only cpuset cpu io pids — no memory. Same for the user@1001.service slice where the rootless UniFi container runs.
  3. Because there is no memory controller, the kernel never creates the memory.events file inside any container cgroup. conmon (the container monitor podman leaves running per container) always tries to inotify-watch memory.events to report OOM events — it fails, logs the two lines, retries ~every 30s, and repeats forever.

So the missing file and the warnings are the same fact: memory accounting is turned off.

Where cgroup_disable=memory comes from

It is not in your /boot/firmware/cmdline.txt. It is injected automatically by the Raspberry Pi firmware/bootloader, which disables the memory cgroup by default on Pi to save a small amount of RAM overhead. The fix is to override it by appending an enable flag to cmdline.txt, which appears later on the command line and wins.

The fix

Add cgroup_enable=memory cgroup_memory=1 to the single line in /boot/firmware/cmdline.txt, then reboot. cmdline.txt must stay one line — everything space-separated, no newlines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment