Repository navigation
Description
Summary
systemd-oomd permanently stops monitoring user@<uid>.service after a
systemctl --user daemon-reload is issued in that user's manager. The cgroup is
silently removed from oomd's monitored set and is never re-registered, even though
the unit keeps running with ManagedOOMMemoryPressure=kill set throughout.
Only cgroups reported by PID 1 are affected. Cgroups reported by the user
manager (e.g. transient app-*.scope units) survive the reload and continue to
register normally afterwards, which makes the loss easy to miss — oomctl still
shows entries and the service still reports Dry Run: no.
Reproduced on systemd 261 (Arch, vanilla) and systemd 259 (Ubuntu 26.04).
Steps to reproduce
Requires ManagedOOMMemoryPressure=kill on [email protected]. Ubuntu ships this by
default in /usr/lib/systemd/system/[email protected]/10-oomd-user-service-defaults.conf;
on other distributions add it manually:
# /etc/systemd/system/[email protected]/10-oomd.conf
[Service]
ManagedOOMMemoryPressure=kill
ManagedOOMMemoryPressureLimit=50%Then:
# systemctl daemon-reload
# systemctl enable --now systemd-oomd
# useradd -m testu && loginctl enable-linger testu
# sleep 15
# oomctl | grep -A1 'Monitored CGroups'
Memory Pressure Monitored CGroups:
Path: /user.slice/user-1000.slice/[email protected]
# runuser -u testu -- env XDG_RUNTIME_DIR=/run/user/1000 systemctl --user daemon-reload
# oomctl | grep -A1 'Monitored CGroups'
Memory Pressure Monitored CGroups:The entry does not return. Re-checked at +5 s, +15 s and +30 s; still absent after
16 minutes on a physical host. systemctl restart systemd-oomd re-registers it
immediately, until the next --user daemon-reload.
Expected behaviour
systemd-oomd.service(8) states that oomd "retrieves information about such units
from systemd(1) when it starts and watches for subsequent changes". A unit that is
running continuously with ManagedOOMMemoryPressure=kill should remain monitored
across an unrelated reload of a user manager.
Actual behaviour
The registration is dropped and never restored.
Environment
Reproduced in a clean-room VM on current upstream:
systemd 261 (261.1-1-arch)
Arch Linux, kernel 7.1.3-arch1-3
cgroup2fs, /proc/pressure/memory present
Verbatim console output from that run:
STEP 1 -- BASELINE (before any user daemon-reload)
Memory Pressure Monitored CGroups:
Path: /user.slice/user-1000.slice/[email protected]
Memory Pressure Limit: 50.00%
Memory Pressure Duration: 30s
>>> [email protected] monitored: 1 total paths: 1
STEP 2 -- TRIGGER: systemctl --user daemon-reload
reload issued OK
+5s user@1000 monitored: 0 total: 0
+15s user@1000 monitored: 0 total: 0
+30s user@1000 monitored: 0 total: 0
RESULT
before reload : 1
after reload : 0
Also reproduced on:
systemd 259 (259.5-0ubuntu3)
Ubuntu 26.04 LTS, kernel 7.0.0-28-generic
SDDM, loginctl Linger=yes
On that host the unit demonstrably never restarted across the loss:
$ systemctl show [email protected] -p ActiveEnterTimestamp -p NRestarts -p SubState
ActiveEnterTimestamp=Mon 2026-07-27 06:49:51 SAST
NRestarts=0
SubState=running
$ systemctl show [email protected] -p ManagedOOMMemoryPressure
ManagedOOMMemoryPressure=killImpact
On a desktop this is triggered by ordinary graphical login: the user manager issues a
daemon-reload shortly after session start. On the Ubuntu host above, [email protected]
was registered ~60 s after boot and lost at login, roughly four minutes later.
The failure is silent and the guardrail looks healthy afterwards:
systemctl is-active systemd-oomd→activeorg.freedesktop.oom1owned on the busoomctlreportsDry Run: noand still listsapp-*.scopeentries
Because user services default to ManagedOOMMemoryPressure=auto (observe-only) and
are eligible for kill only as descendants of a monitored ancestor, losing
user@<uid>.service means a runaway user service is unprotected. Any user-unit
installation that triggers a --user daemon-reload re-breaks it mid-session.
Ruled out
- systemd-oomd.socket fails on new user session without pressure support #27690 (
systemd-oomd.sockettrigger-limit loop when/proc/pressure/memoryis
missing) — noTrigger limit hitmessages; socket healthy;memory.pressurepresent
on the user slice in both environments. - oomd fails during pid1 daemon-reexec #20330 (oomd loses its varlink connection to PID 1 on
daemon-reexec) — closed
for v252; no varlink errors logged in either environment; the trigger here is a
user manager reload, not a PID 1 re-exec. - Strange oomd behavior with user services #21684 (oomd kills the wrong user service) — different failure mode.
- Start ordering — on the Ubuntu host oomd started at 06:49:42 and
[email protected]at 06:49:51, i.e. oomd was already running, and registration
demonstrably succeeded before being lost. - oomd replacing rather than merging its set — tested directly: starting an
additional user unit withManagedOOMMemoryPressure=killadded to the monitored
set (4 → 5 paths) with[email protected]still present. Merging works; only
daemon-reloadtriggers the loss.
Additional notes
No varlink or ManagedOOM errors appear in the journal at any point, on either system.
In the VM the monitored set drops to zero paths, since no app-*.scope units exist.
On a desktop those scopes remain and mask the loss, which is likely why this is not
more widely reported.
Activity
WingedGuardian commentedon Nov 3, 2026
Reproduced on systemd 255 (Ubuntu 24.04 packaging), and I think the cause is a path collision between two reporters rather than anything specific to the reload itself.
The user manager's root slice,
-.slice, has as its cgroup path the cgroup ofuser@<uid>.serviceitself (systemctl --user show -p ControlGroup -- -.sliceprints/user.slice/user-<uid>.slice/user@<uid>.service). So two managers report on the same cgroup path:user@<uid>.servicewithManagedOOMMemoryPressure=kill(from the vendor drop-in).-.slice, whose mode is the defaultauto.On
systemctl --user daemon-reload, the user manager re-loads its units. After deserialization-.slicegoes through a state change to active, andunit_notify()callsmanager_varlink_send_managed_oom_update()for it unconditionally on that transition (src/core/unit.c, the "indiscriminately send an update" block). That sends{"mode":"auto","path":"/user.slice/user-<uid>.slice/user@<uid>.service","property":"ManagedOOMMemoryPressure"}overio.systemd.oom.ReportManagedOOMCGroups.In
process_managed_oom_message()(src/oom/oomd-manager.c) the owner check passes, because the sender uid owns that cgroup. Thenmode == MANAGED_OOM_AUTOremoves the entry for that path frommonitored_mem_pressure_cgroup_contexts, and that entry is the one PID 1 registered. Nothing re-sends PID 1's entry untiluser@<uid>.serviceitself changes state or oomd re-subscribes, which matches the report: it comes back onsystemctl restart systemd-oomdand nowhere else.Two consequences that fit the observations above:
user@path.oomctloutput except as a missing line.A workaround that holds across user reloads, confirmed with
oomctlafter repeatedsystemctl --user daemon-reload: give the user manager's root slice the same policy, so its own report sayskillfor that path:Keep the limit equal to the one on
[email protected]: both reports target one path, and the last message received sets the limit.Possible fixes: have the user manager skip ManagedOOM reports for its root slice (its cgroup belongs to the unit PID 1 manages), or have oomd key entries by reporter as well as path, so that one reporter's
autocannot remove another reporter'skill.fix: work around NVIDIA RTD3 on Linux 7.3 and oomd losing the user se…
partymola commentedon Nov 25, 2026
Same here on 262.2 (Arch,
262.2-1-arch). On Arch it is also set off by package upgrades: the pacman hook30-systemd-daemon-reload-user.hookrunssystemctl reload 'user@*.service'after any transaction that touchesusr/lib/systemd/user/*, and the session then stays out of oomd until[email protected]restarts.The
-.sliceworkaround from the comment above works for me system-wide in/etc/systemd/user/-.slice.d/. With it,[email protected]stays listed inoomctlaftersystemctl reload 'user@*.service'.