Skip to content

housekeeping: Add systemd OOM notification module#454

Open
Fantu wants to merge 1 commit into
linuxmint:masterfrom
Fantu:systemd-oom-notification
Open

housekeeping: Add systemd OOM notification module#454
Fantu wants to merge 1 commit into
linuxmint:masterfrom
Fantu:systemd-oom-notification

Conversation

@Fantu
Copy link
Copy Markdown
Contributor

@Fantu Fantu commented May 10, 2026

Notify the user when systemd kills a unit (scope/service) due to an out-of-memory event. The notification reports the application name when the desktop entry can be resolved from the cgroup unit name, with a generic fallback for virtual terminals and unknown units.

Note that we only notify if a unit (scope/service) is actually stopped due to OOM. This will not catch certain other cases where e.g. a delegated cgroup receives an OOM event.

Ported from gnome-settings-daemon, squashing the following upstream commits:

d1fe7167 housekeeping: Add systemd OOM notification module
fb4edd88 housekeeping: fix capitalization of systemd notifications
e6c41410 Use the proper hint for setting images for notifications
dfb7aeab housekeeping: Fix wording in the OOM kill message
79d4fc90 housekeeping: Fix systemd OOM notifications
(call org.freedesktop.systemd1.Manager.Subscribe so that
PropertiesChanged signals are actually emitted)

Adaptations vs. upstream:

  • Renamed symbols/files to the cinnamon-settings-daemon prefixes (gsd -> csd, Gsd -> Csd, GSD -> CSD).
  • The new CsdSystemdNotify instance is held in the private struct CsdHousekeepingManagerPrivate, since CsdHousekeepingManager still uses g_type_class_add_private rather than inline struct fields like the upstream GsdHousekeepingManager.

Notify the user when systemd kills a unit (scope/service) due to an
out-of-memory event. The notification reports the application name when
the desktop entry can be resolved from the cgroup unit name, with a
generic fallback for virtual terminals and unknown units.

Note that we only notify if a unit (scope/service) is actually stopped
due to OOM. This will not catch certain other cases where e.g. a
delegated cgroup receives an OOM event.

Ported from gnome-settings-daemon, squashing the following upstream
commits:

  d1fe7167 housekeeping: Add systemd OOM notification module
  fb4edd88 housekeeping: fix capitalization of systemd notifications
  e6c41410 Use the proper hint for setting images for notifications
  dfb7aeab housekeeping: Fix wording in the OOM kill message
  79d4fc90 housekeeping: Fix systemd OOM notifications
            (call org.freedesktop.systemd1.Manager.Subscribe so that
            PropertiesChanged signals are actually emitted)

Adaptations vs. upstream:
 - Renamed symbols/files to the cinnamon-settings-daemon prefixes
   (gsd -> csd, Gsd -> Csd, GSD -> CSD).
 - The new CsdSystemdNotify instance is held in the private struct
   CsdHousekeepingManagerPrivate, since CsdHousekeepingManager still
   uses g_type_class_add_private rather than inline struct fields like
   the upstream GsdHousekeepingManager.
@Fantu
Copy link
Copy Markdown
Contributor Author

Fantu commented May 10, 2026

I think is useful for users that want use systemd-oomd and for distro that use it by default like Fedora and Ubuntu.

I haven't tested it yet, and I probably won't have time to do so until next weekend.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant