[PATCH] Do not emit OOM notifications on systemd services reload
authorAntonio Rojas <arojas@archlinux.org>
Sat, 5 Jul 2025 19:52:31 +0000 (19:52 +0000)
committerAurélien COUDERC <coucouf@debian.org>
Mon, 21 Jul 2025 16:21:10 +0000 (18:21 +0200)
When systemd services are reloaded, systemd emits all PropertiesChanged signals for all units.

Comparing with the original signals these have a null MainPID, so we can use that to identify them and not emit a notification.

BUG: 502279

(cherry picked from commit ce33b24d4f1b5711f7585b33822ab87f2f43af0b)

ce33b24d Do not emit OOM notifications on systemd services reload

Co-authored-by: Antonio Rojas <arojas@archlinux.org>
Gbp-Pq: Name upstream_ec837446_Do-not-emit-OOM-notifications-on-systemd-services-reload.patch

oom-notifier/module.cpp

index 64cf322bc74be3f9672427220dbcf8ae4affd8d8..127b8d22ee9e1ea0f995c7e905ffcdb1c90d56c4 100644 (file)
@@ -57,6 +57,9 @@ public:
                     if (changed.value(u"Result"_s, QString()) != "oom-kill"_L1) {
                         return;
                     }
+                    if (changed.value(u"MainPID"_s) == 0) {
+                        return;
+                    }
 
                     const auto unit = decodeUnitName(QFileInfo(msg.path()).fileName());
                     const auto service = serviceForUnitName(unit);