From b2bfd121b740d9f47c30118bcc216a5f091fb540 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 30 Jun 2023 15:35:49 +0200 Subject: [PATCH] pid1: also encode whether to send plymouth notifications in UnitVTable --- src/core/manager.c | 2 +- src/core/mount.c | 2 ++ src/core/service.c | 2 ++ src/core/swap.c | 2 ++ src/core/unit.h | 3 +++ 5 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/core/manager.c b/src/core/manager.c index 21d2e092fa..35b90e2159 100644 --- a/src/core/manager.c +++ b/src/core/manager.c @@ -3386,7 +3386,7 @@ void manager_send_unit_plymouth(Manager *m, Unit *u) { if (detect_container() > 0) return; - if (!IN_SET(u->type, UNIT_SERVICE, UNIT_MOUNT, UNIT_SWAP)) + if (!UNIT_VTABLE(u)->notify_plymouth) return; /* We set SOCK_NONBLOCK here so that we rather drop the diff --git a/src/core/mount.c b/src/core/mount.c index 542c39e186..1424ad2bf4 100644 --- a/src/core/mount.c +++ b/src/core/mount.c @@ -2398,4 +2398,6 @@ const UnitVTable mount_vtable = { }, .can_start = mount_can_start, + + .notify_plymouth = true, }; diff --git a/src/core/service.c b/src/core/service.c index 3f27e28a7d..93545a252a 100644 --- a/src/core/service.c +++ b/src/core/service.c @@ -5168,6 +5168,8 @@ const UnitVTable service_vtable = { .can_start = service_can_start, + .notify_plymouth = true, + .audit_start_message_type = AUDIT_SERVICE_START, .audit_stop_message_type = AUDIT_SERVICE_STOP, }; diff --git a/src/core/swap.c b/src/core/swap.c index a57176b1a3..73cf320bfd 100644 --- a/src/core/swap.c +++ b/src/core/swap.c @@ -1687,4 +1687,6 @@ const UnitVTable swap_vtable = { }, .can_start = swap_can_start, + + .notify_plymouth = true, }; diff --git a/src/core/unit.h b/src/core/unit.h index 20b00799b7..3a7330c24f 100644 --- a/src/core/unit.h +++ b/src/core/unit.h @@ -783,6 +783,9 @@ typedef struct UnitVTable { /* True if systemd-oomd can monitor and act on this unit's recursive children's cgroups */ bool can_set_managed_oom; + /* If true, we'll notify plymouth about this unit */ + bool notify_plymouth; + /* The audit events to generate on start + stop (or 0 if none shall be generated) */ int audit_start_message_type; int audit_stop_message_type;