]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
service: transition unit from SERVICE_DEAD_RESOURCES_PINNED to SERVICE_DEAD when...
authorLuca Boccassi <luca.boccassi@gmail.com>
Thu, 2 Apr 2026 11:08:56 +0000 (12:08 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Thu, 2 Apr 2026 11:22:43 +0000 (12:22 +0100)
Follow-up for b9c1883a9cd9b5126fe648f3e198143dc19a222d

src/core/service.c

index 51bba291e8fd45a98f550f6a51bb042e32a6aa89..b511b422ac3d1bf35e2c96288538b6b02e3675d2 100644 (file)
@@ -138,6 +138,8 @@ static void service_enter_reload_by_notify(Service *s);
 
 static bool service_can_reload_extensions(Service *s, bool warn);
 
+static void service_set_state(Service *s, ServiceState state);
+
 static bool SERVICE_STATE_WITH_MAIN_PROCESS(ServiceState state) {
         return IN_SET(state,
                       SERVICE_START, SERVICE_START_POST,
@@ -571,15 +573,20 @@ static void service_done(Unit *u) {
 
 static int on_fd_store_io(sd_event_source *e, int fd, uint32_t revents, void *userdata) {
         ServiceFDStore *fs = ASSERT_PTR(userdata);
+        Service *s = fs->service;
 
         assert(e);
 
         /* If we get either EPOLLHUP or EPOLLERR, it's time to remove this entry from the fd store */
-        log_unit_debug(UNIT(fs->service),
+        log_unit_debug(UNIT(s),
                        "Received %s on stored fd %d (%s), closing.",
                        revents & EPOLLERR ? "EPOLLERR" : "EPOLLHUP",
                        fs->fd, strna(fs->fdname));
         service_fd_store_unlink(fs);
+
+        if (s->state == SERVICE_DEAD_RESOURCES_PINNED && !s->fd_store)
+                service_set_state(s, SERVICE_DEAD);
+
         return 0;
 }